@jscrpt/common 2.0.3 → 2.2.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.
- package/changelog.md +31 -0
- package/es/rxjs/src/index.js.map +1 -0
- package/es/rxjs/src/index.mjs +3 -0
- package/es/rxjs/src/types/async.js.map +1 -0
- package/es/rxjs/src/types/async.mjs +2 -0
- package/es/rxjs/src/utils/async.js.map +1 -0
- package/es/rxjs/src/utils/async.mjs +21 -0
- package/{dist/es → es/src}/decorators/bindThis.decorator.js.map +1 -1
- package/{dist/es → es/src}/decorators/bindThis.decorator.mjs +0 -0
- package/{dist/es → es/src}/decorators/callOnce.decorator.js.map +0 -0
- package/{dist/es → es/src}/decorators/callOnce.decorator.mjs +0 -0
- package/{dist/es → es/src}/decorators/debounceCall.decorator.js.map +0 -0
- package/{dist/es → es/src}/decorators/debounceCall.decorator.mjs +0 -0
- package/{dist/es → es/src}/encoder/encoder.js.map +0 -0
- package/{dist/es → es/src}/encoder/encoder.mjs +0 -0
- package/{dist/es → es/src}/enums/orderByDirection.js.map +0 -0
- package/{dist/es → es/src}/enums/orderByDirection.mjs +0 -0
- package/es/src/index.js.map +1 -0
- package/{dist/es → es/src}/index.mjs +5 -0
- package/{dist/es → es/src}/indexNode.js.map +0 -0
- package/{dist/es → es/src}/indexNode.mjs +0 -0
- package/{dist/es → es/src}/jsDevMode.js.map +0 -0
- package/{dist/es → es/src}/jsDevMode.mjs +0 -0
- package/{dist/es → es/src}/normalizer/charMaps.js.map +0 -0
- package/{dist/es → es/src}/normalizer/charMaps.mjs +0 -0
- package/{dist/es → es/src}/normalizer/normalizer.js.map +0 -0
- package/{dist/es → es/src}/normalizer/normalizer.mjs +0 -0
- package/{dist/es → es/src}/paginator/paginator.js.map +0 -0
- package/{dist/es → es/src}/paginator/paginator.mjs +0 -0
- package/es/src/types/async.js.map +1 -0
- package/es/src/types/async.mjs +2 -0
- package/es/src/types/cssProperties.js.map +1 -0
- package/es/src/types/cssProperties.mjs +2 -0
- package/{dist/es → es/src}/types/dictionaries.js.map +1 -1
- package/{dist/es → es/src}/types/dictionaries.mjs +0 -0
- package/{dist/es → es/src}/types/enums.js.map +1 -1
- package/{dist/es → es/src}/types/enums.mjs +0 -0
- package/es/src/types/functions.js.map +1 -0
- package/{dist/es → es/src}/types/functions.mjs +0 -0
- package/es/src/types/pageable.js.map +1 -0
- package/es/src/types/pageable.mjs +2 -0
- package/es/src/types/pagedData.js.map +1 -0
- package/es/src/types/pagedData.mjs +2 -0
- package/{dist/es → es/src}/types/valueNamePair.js.map +0 -0
- package/{dist/es → es/src}/types/valueNamePair.mjs +0 -0
- package/es/src/utils/async.js.map +1 -0
- package/es/src/utils/async.mjs +14 -0
- package/es/src/utils/common.js.map +1 -0
- package/{dist/es → es/src}/utils/common.mjs +16 -0
- package/{dist/es → es/src}/utils/lang.js.map +0 -0
- package/{dist/es → es/src}/utils/lang.mjs +0 -0
- package/{dist/es → es/src}/utils/nameof.js.map +0 -0
- package/{dist/es → es/src}/utils/nameof.mjs +0 -0
- package/es2015/rxjs/src/index.js +3 -0
- package/es2015/rxjs/src/index.js.map +1 -0
- package/es2015/rxjs/src/types/async.js +2 -0
- package/es2015/rxjs/src/types/async.js.map +1 -0
- package/es2015/rxjs/src/utils/async.js +21 -0
- package/es2015/rxjs/src/utils/async.js.map +1 -0
- package/{dist/es2015 → es2015/src}/decorators/bindThis.decorator.js +0 -0
- package/{dist/es5 → es2015/src}/decorators/bindThis.decorator.js.map +1 -1
- package/{dist/es2015 → es2015/src}/decorators/callOnce.decorator.js +0 -0
- package/{dist/es2015 → es2015/src}/decorators/callOnce.decorator.js.map +0 -0
- package/{dist/es2015 → es2015/src}/decorators/debounceCall.decorator.js +0 -0
- package/{dist/es2015 → es2015/src}/decorators/debounceCall.decorator.js.map +0 -0
- package/{dist/es2015 → es2015/src}/encoder/encoder.js +0 -0
- package/{dist/es2015 → es2015/src}/encoder/encoder.js.map +0 -0
- package/{dist/es2015 → es2015/src}/enums/orderByDirection.js +0 -0
- package/{dist/es2015 → es2015/src}/enums/orderByDirection.js.map +0 -0
- package/{dist/es2020 → es2015/src}/index.js +5 -0
- package/es2015/src/index.js.map +1 -0
- package/{dist/es2015 → es2015/src}/indexNode.js +0 -0
- package/{dist/es2015 → es2015/src}/indexNode.js.map +0 -0
- package/{dist/es2015 → es2015/src}/jsDevMode.js +0 -0
- package/{dist/es2015 → es2015/src}/jsDevMode.js.map +0 -0
- package/{dist/es2015 → es2015/src}/normalizer/charMaps.js +0 -0
- package/{dist/es2015 → es2015/src}/normalizer/charMaps.js.map +0 -0
- package/{dist/es2015 → es2015/src}/normalizer/normalizer.js +0 -0
- package/{dist/es2015 → es2015/src}/normalizer/normalizer.js.map +0 -0
- package/{dist/es2015 → es2015/src}/paginator/paginator.js +0 -0
- package/{dist/es2015 → es2015/src}/paginator/paginator.js.map +0 -0
- package/es2015/src/types/async.js +2 -0
- package/es2015/src/types/async.js.map +1 -0
- package/es2015/src/types/cssProperties.js +2 -0
- package/es2015/src/types/cssProperties.js.map +1 -0
- package/{dist/es2015 → es2015/src}/types/dictionaries.js +0 -0
- package/{dist/es2015 → es2015/src}/types/dictionaries.js.map +1 -1
- package/{dist/es2015 → es2015/src}/types/enums.js +0 -0
- package/{dist/es2015 → es2015/src}/types/enums.js.map +1 -1
- package/{dist/es2015 → es2015/src}/types/functions.js +0 -0
- package/es2015/src/types/functions.js.map +1 -0
- package/es2015/src/types/pageable.js +2 -0
- package/es2015/src/types/pageable.js.map +1 -0
- package/es2015/src/types/pagedData.js +2 -0
- package/es2015/src/types/pagedData.js.map +1 -0
- package/{dist/es2015 → es2015/src}/types/valueNamePair.js +0 -0
- package/{dist/es2015 → es2015/src}/types/valueNamePair.js.map +0 -0
- package/es2015/src/utils/async.js +14 -0
- package/es2015/src/utils/async.js.map +1 -0
- package/{dist/es2015 → es2015/src}/utils/common.js +16 -0
- package/es2015/src/utils/common.js.map +1 -0
- package/{dist/es2015 → es2015/src}/utils/lang.js +0 -0
- package/{dist/es2015 → es2015/src}/utils/lang.js.map +0 -0
- package/{dist/es2015 → es2015/src}/utils/nameof.js +0 -0
- package/{dist/es2015 → es2015/src}/utils/nameof.js.map +0 -0
- package/es2020/rxjs/src/index.js +3 -0
- package/es2020/rxjs/src/index.js.map +1 -0
- package/es2020/rxjs/src/types/async.js +2 -0
- package/es2020/rxjs/src/types/async.js.map +1 -0
- package/es2020/rxjs/src/utils/async.js +21 -0
- package/es2020/rxjs/src/utils/async.js.map +1 -0
- package/{dist/es2020 → es2020/src}/decorators/bindThis.decorator.js +0 -0
- package/{dist/es2020 → es2020/src}/decorators/bindThis.decorator.js.map +1 -1
- package/{dist/es2020 → es2020/src}/decorators/callOnce.decorator.js +0 -0
- package/{dist/es2020 → es2020/src}/decorators/callOnce.decorator.js.map +0 -0
- package/{dist/es2020 → es2020/src}/decorators/debounceCall.decorator.js +0 -0
- package/{dist/es2020 → es2020/src}/decorators/debounceCall.decorator.js.map +0 -0
- package/{dist/es2020 → es2020/src}/encoder/encoder.js +0 -0
- package/{dist/es2020 → es2020/src}/encoder/encoder.js.map +0 -0
- package/{dist/es2020 → es2020/src}/enums/orderByDirection.js +0 -0
- package/{dist/es2020 → es2020/src}/enums/orderByDirection.js.map +0 -0
- package/{dist/es2015 → es2020/src}/index.js +5 -0
- package/es2020/src/index.js.map +1 -0
- package/{dist/es2020 → es2020/src}/indexNode.js +0 -0
- package/{dist/es2020 → es2020/src}/indexNode.js.map +0 -0
- package/{dist/es2020 → es2020/src}/jsDevMode.js +0 -0
- package/{dist/es2020 → es2020/src}/jsDevMode.js.map +0 -0
- package/{dist/es2020 → es2020/src}/normalizer/charMaps.js +0 -0
- package/{dist/es2020 → es2020/src}/normalizer/charMaps.js.map +0 -0
- package/{dist/es2020 → es2020/src}/normalizer/normalizer.js +0 -0
- package/{dist/es2020 → es2020/src}/normalizer/normalizer.js.map +0 -0
- package/{dist/es2020 → es2020/src}/paginator/paginator.js +0 -0
- package/{dist/es2020 → es2020/src}/paginator/paginator.js.map +0 -0
- package/es2020/src/types/async.js +2 -0
- package/es2020/src/types/async.js.map +1 -0
- package/es2020/src/types/cssProperties.js +2 -0
- package/es2020/src/types/cssProperties.js.map +1 -0
- package/{dist/es2020 → es2020/src}/types/dictionaries.js +0 -0
- package/{dist/es2020 → es2020/src}/types/dictionaries.js.map +1 -1
- package/{dist/es2020 → es2020/src}/types/enums.js +0 -0
- package/{dist/es2020 → es2020/src}/types/enums.js.map +1 -1
- package/{dist/es2020 → es2020/src}/types/functions.js +0 -0
- package/es2020/src/types/functions.js.map +1 -0
- package/es2020/src/types/pageable.js +2 -0
- package/es2020/src/types/pageable.js.map +1 -0
- package/es2020/src/types/pagedData.js +2 -0
- package/es2020/src/types/pagedData.js.map +1 -0
- package/{dist/es2020 → es2020/src}/types/valueNamePair.js +0 -0
- package/{dist/es2020 → es2020/src}/types/valueNamePair.js.map +0 -0
- package/es2020/src/utils/async.js +11 -0
- package/es2020/src/utils/async.js.map +1 -0
- package/{dist/es2020 → es2020/src}/utils/common.js +16 -0
- package/es2020/src/utils/common.js.map +1 -0
- package/{dist/es2020 → es2020/src}/utils/lang.js +0 -0
- package/{dist/es2020 → es2020/src}/utils/lang.js.map +0 -0
- package/{dist/es2020 → es2020/src}/utils/nameof.js +0 -0
- package/{dist/es2020 → es2020/src}/utils/nameof.js.map +0 -0
- package/es5/rxjs/src/index.js +3 -0
- package/es5/rxjs/src/index.js.map +1 -0
- package/es5/rxjs/src/types/async.js +2 -0
- package/es5/rxjs/src/types/async.js.map +1 -0
- package/es5/rxjs/src/utils/async.js +21 -0
- package/es5/rxjs/src/utils/async.js.map +1 -0
- package/{dist/es5 → es5/src}/decorators/bindThis.decorator.js +1 -1
- package/es5/src/decorators/bindThis.decorator.js.map +1 -0
- package/{dist/es5 → es5/src}/decorators/callOnce.decorator.js +1 -1
- package/{dist/es5 → es5/src}/decorators/callOnce.decorator.js.map +1 -1
- package/{dist/es5 → es5/src}/decorators/debounceCall.decorator.js +1 -1
- package/{dist/es5 → es5/src}/decorators/debounceCall.decorator.js.map +1 -1
- package/{dist/es5 → es5/src}/encoder/encoder.js +0 -0
- package/{dist/es5 → es5/src}/encoder/encoder.js.map +0 -0
- package/{dist/es5 → es5/src}/enums/orderByDirection.js +0 -0
- package/{dist/es5 → es5/src}/enums/orderByDirection.js.map +0 -0
- package/{dist/es5 → es5/src}/index.js +5 -0
- package/es5/src/index.js.map +1 -0
- package/{dist/es5 → es5/src}/indexNode.js +0 -0
- package/{dist/es5 → es5/src}/indexNode.js.map +0 -0
- package/{dist/es5 → es5/src}/jsDevMode.js +0 -0
- package/{dist/es5 → es5/src}/jsDevMode.js.map +0 -0
- package/{dist/es5 → es5/src}/normalizer/charMaps.js +0 -0
- package/{dist/es5 → es5/src}/normalizer/charMaps.js.map +0 -0
- package/{dist/es5 → es5/src}/normalizer/normalizer.js +0 -0
- package/{dist/es5 → es5/src}/normalizer/normalizer.js.map +0 -0
- package/{dist/es5 → es5/src}/paginator/paginator.js +0 -0
- package/{dist/es5 → es5/src}/paginator/paginator.js.map +0 -0
- package/es5/src/types/async.js +2 -0
- package/es5/src/types/async.js.map +1 -0
- package/es5/src/types/cssProperties.js +2 -0
- package/es5/src/types/cssProperties.js.map +1 -0
- package/{dist/es5 → es5/src}/types/dictionaries.js +0 -0
- package/{dist/es5 → es5/src}/types/dictionaries.js.map +1 -1
- package/{dist/es5 → es5/src}/types/enums.js +0 -0
- package/{dist/es5 → es5/src}/types/enums.js.map +1 -1
- package/{dist/es5 → es5/src}/types/functions.js +0 -0
- package/es5/src/types/functions.js.map +1 -0
- package/es5/src/types/pageable.js +2 -0
- package/es5/src/types/pageable.js.map +1 -0
- package/es5/src/types/pagedData.js +2 -0
- package/es5/src/types/pagedData.js.map +1 -0
- package/{dist/es5 → es5/src}/types/valueNamePair.js +0 -0
- package/{dist/es5 → es5/src}/types/valueNamePair.js.map +0 -0
- package/es5/src/utils/async.js +19 -0
- package/es5/src/utils/async.js.map +1 -0
- package/{dist/es5 → es5/src}/utils/common.js +19 -1
- package/es5/src/utils/common.js.map +1 -0
- package/{dist/es5 → es5/src}/utils/lang.js +0 -0
- package/{dist/es5 → es5/src}/utils/lang.js.map +0 -0
- package/{dist/es5 → es5/src}/utils/nameof.js +0 -0
- package/{dist/es5 → es5/src}/utils/nameof.js.map +0 -0
- package/module/rxjs/src/index.cjs +6 -0
- package/module/rxjs/src/index.js.map +1 -0
- package/module/rxjs/src/types/async.cjs +3 -0
- package/module/rxjs/src/types/async.js.map +1 -0
- package/module/rxjs/src/utils/async.cjs +25 -0
- package/module/rxjs/src/utils/async.js.map +1 -0
- package/{dist/module → module/src}/decorators/bindThis.decorator.cjs +0 -0
- package/{dist/module → module/src}/decorators/bindThis.decorator.js.map +1 -1
- package/{dist/module → module/src}/decorators/callOnce.decorator.cjs +0 -0
- package/{dist/module → module/src}/decorators/callOnce.decorator.js.map +0 -0
- package/{dist/module → module/src}/decorators/debounceCall.decorator.cjs +0 -0
- package/{dist/module → module/src}/decorators/debounceCall.decorator.js.map +0 -0
- package/{dist/module → module/src}/encoder/encoder.cjs +0 -0
- package/{dist/module → module/src}/encoder/encoder.js.map +0 -0
- package/{dist/module → module/src}/enums/orderByDirection.cjs +0 -0
- package/{dist/module → module/src}/enums/orderByDirection.js.map +0 -0
- package/{dist/module → module/src}/index.cjs +5 -0
- package/module/src/index.js.map +1 -0
- package/{dist/module → module/src}/indexNode.cjs +0 -0
- package/{dist/module → module/src}/indexNode.js.map +0 -0
- package/{dist/module → module/src}/jsDevMode.cjs +0 -0
- package/{dist/module → module/src}/jsDevMode.js.map +0 -0
- package/{dist/module → module/src}/normalizer/charMaps.cjs +0 -0
- package/{dist/module → module/src}/normalizer/charMaps.js.map +0 -0
- package/{dist/module → module/src}/normalizer/normalizer.cjs +0 -0
- package/{dist/module → module/src}/normalizer/normalizer.js.map +0 -0
- package/{dist/module → module/src}/paginator/paginator.cjs +0 -0
- package/{dist/module → module/src}/paginator/paginator.js.map +0 -0
- package/module/src/types/async.cjs +3 -0
- package/module/src/types/async.js.map +1 -0
- package/module/src/types/cssProperties.cjs +3 -0
- package/module/src/types/cssProperties.js.map +1 -0
- package/{dist/module → module/src}/types/dictionaries.cjs +0 -0
- package/{dist/module → module/src}/types/dictionaries.js.map +1 -1
- package/{dist/module → module/src}/types/enums.cjs +0 -0
- package/{dist/module → module/src}/types/enums.js.map +1 -1
- package/{dist/module → module/src}/types/functions.cjs +0 -0
- package/module/src/types/functions.js.map +1 -0
- package/module/src/types/pageable.cjs +3 -0
- package/module/src/types/pageable.js.map +1 -0
- package/module/src/types/pagedData.cjs +3 -0
- package/module/src/types/pagedData.js.map +1 -0
- package/{dist/module → module/src}/types/valueNamePair.cjs +0 -0
- package/{dist/module → module/src}/types/valueNamePair.js.map +0 -0
- package/module/src/utils/async.cjs +18 -0
- package/module/src/utils/async.js.map +1 -0
- package/{dist/module → module/src}/utils/common.cjs +18 -1
- package/module/src/utils/common.js.map +1 -0
- package/{dist/module → module/src}/utils/lang.cjs +0 -0
- package/{dist/module → module/src}/utils/lang.js.map +0 -0
- package/{dist/module → module/src}/utils/nameof.cjs +0 -0
- package/{dist/module → module/src}/utils/nameof.js.map +0 -0
- package/package.json +49 -30
- package/rxjs/package.json +11 -0
- package/rxjs/src/index.d.ts +3 -0
- package/rxjs/src/index.d.ts.map +1 -0
- package/rxjs/src/types/async.d.ts +6 -0
- package/rxjs/src/types/async.d.ts.map +1 -0
- package/rxjs/src/utils/async.d.ts +7 -0
- package/rxjs/src/utils/async.d.ts.map +1 -0
- package/src/decorators/bindThis.decorator.d.ts +1 -1
- package/src/decorators/bindThis.decorator.d.ts.map +1 -1
- package/src/index.d.ts +5 -0
- package/src/index.d.ts.map +1 -1
- package/src/types/async.d.ts +5 -0
- package/src/types/async.d.ts.map +1 -0
- package/src/types/cssProperties.d.ts +17 -0
- package/src/types/cssProperties.d.ts.map +1 -0
- package/src/types/dictionaries.d.ts +6 -0
- package/src/types/dictionaries.d.ts.map +1 -1
- package/src/types/functions.d.ts +8 -2
- package/src/types/functions.d.ts.map +1 -1
- package/src/types/pageable.d.ts +14 -0
- package/src/types/pageable.d.ts.map +1 -0
- package/src/types/pagedData.d.ts +38 -0
- package/src/types/pagedData.d.ts.map +1 -0
- package/src/utils/async.d.ts +7 -0
- package/src/utils/async.d.ts.map +1 -0
- package/src/utils/common.d.ts +7 -0
- package/src/utils/common.d.ts.map +1 -1
- package/version.bak +1 -1
- package/dist/es/index.js.map +0 -1
- package/dist/es/types/functions.js.map +0 -1
- package/dist/es/utils/common.js.map +0 -1
- package/dist/es2015/decorators/bindThis.decorator.js.map +0 -1
- package/dist/es2015/index.js.map +0 -1
- package/dist/es2015/types/functions.js.map +0 -1
- package/dist/es2015/utils/common.js.map +0 -1
- package/dist/es2020/index.js.map +0 -1
- package/dist/es2020/types/functions.js.map +0 -1
- package/dist/es2020/utils/common.js.map +0 -1
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/types/functions.js.map +0 -1
- package/dist/es5/utils/common.js.map +0 -1
- package/dist/module/index.js.map +0 -1
- package/dist/module/types/functions.js.map +0 -1
- package/dist/module/utils/common.js.map +0 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 2.2.0 (2021-12-16)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- fixed `BindThis` now accepts any type of fuction, not only without parameters
|
|
8
|
+
- fixed `Action` now allows correctly to specify type of arguments
|
|
9
|
+
- fixed `Func` now allows correctly to specify type of arguments
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- added `AsAnyDictionary` represents type that extracts class as type Record with property keys as index and any property values
|
|
14
|
+
- added `FuncSignature` type that extracts function signature from function type
|
|
15
|
+
|
|
16
|
+
## Version 2.1.0 (2021-12-15)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- added `mapValuesToThis` function that maps all iterable property values of object to "this" bounded
|
|
21
|
+
- added `Pageable` interface for paging
|
|
22
|
+
- added `PagedData` interface that is representation of data that are paged
|
|
23
|
+
- added `CssGlobal` type that represents css global values, usable for any css property
|
|
24
|
+
- added `CssOverflow` type that represents css overflow values
|
|
25
|
+
- added `CssPosition` type that represents css position values
|
|
26
|
+
- added `CssDisplay` type that represents css display values
|
|
27
|
+
- added `PromiseOr` type that represents pure value or value obtained by promise
|
|
28
|
+
- added `resolvePromiseOr` function that resolves `PromiseOr` value
|
|
29
|
+
- added *subpackage* `@jscrpt/common/rxjs`
|
|
30
|
+
- *subpackage* `@jscrpt/common/rxjs`
|
|
31
|
+
- added `PromiseObservableOr` type that represents pure value or value obtained by promise or value obtained by Observable
|
|
32
|
+
- added `resolvePromiseObservableOr` function that resolves `PromiseObservableOr` value, if value is Observable then can be completed without value and `undefined` is resolved
|
|
33
|
+
|
|
3
34
|
## Version 2.0.3 (2021-11-15)
|
|
4
35
|
|
|
5
36
|
### Bug Fixes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../rxjs/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC","sourcesContent":["export * from './types/async';\nexport * from './utils/async';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.mjs","sourceRoot":"","sources":["../../../../rxjs/src/types/async.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\n/**\n * Type that represents pure value or value obtained by promise or value obtained by Observable\n */\nexport type PromiseObservableOr<TValue> = Observable<TValue>|Promise<TValue>|TValue;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.mjs","sourceRoot":"","sources":["../../../../rxjs/src/utils/async.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAGhC;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAU,KAAmC;IAEnF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAEnC,IAAG,KAAK,YAAY,UAAU,EAC9B;YACI,KAAK,GAAG,KAAK;iBACR,SAAS,EAAE,CAAC;SACpB;QAED,IAAG,KAAK,YAAY,OAAO,EAC3B;YACI,KAAK;iBACA,IAAI,CAAC,OAAO,CAAC;iBACb,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAEnC,OAAO;SACV;QAED,OAAO,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {Observable} from 'rxjs';\nimport {PromiseObservableOr} from '../types/async';\n\n/**\n * Resolves `PromiseObservableOr` value, if value is Observable then can be completed without value and undefined is resolved\n * @param value - Value to be solved\n */\nexport function resolvePromiseObservableOr<TResult>(value: PromiseObservableOr<TResult>): Promise<TResult|undefined>\n{\n return new Promise((resolve, reject) =>\n {\n if(value instanceof Observable)\n {\n value = value\n .toPromise();\n }\n\n if(value instanceof Promise)\n {\n value\n .then(resolve)\n .catch(error => reject(error));\n\n return;\n }\n \n resolve(value);\n });\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `PromiseObservableOr` value, if value is Observable then can be completed without value and undefined is resolved
|
|
4
|
+
* @param value - Value to be solved
|
|
5
|
+
*/
|
|
6
|
+
export function resolvePromiseObservableOr(value) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
if (value instanceof Observable) {
|
|
9
|
+
value = value
|
|
10
|
+
.toPromise();
|
|
11
|
+
}
|
|
12
|
+
if (value instanceof Promise) {
|
|
13
|
+
value
|
|
14
|
+
.then(resolve)
|
|
15
|
+
.catch(error => reject(error));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
resolve(value);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindThis.decorator.mjs","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
|
|
1
|
+
{"version":3,"file":"bindThis.decorator.mjs","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAErC,YAAY,CAAC,MAAM,CAAC,EAAE;IAElB,IAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAC/B;QACI,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;KAC/B;AACL,CAAC,CAAC,CAAC;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC","sourcesContent":["import {globalDefine} from './jsDevMode';\r\nimport {isBlank} from './utils/lang';\r\n\r\nglobalDefine(global =>\r\n{\r\n if(isBlank(global['jsDevMode']))\r\n {\r\n global['jsDevMode'] = false;\r\n }\r\n});\r\n\r\nexport * from './jsDevMode';\r\nexport * from './encoder/encoder';\r\nexport * from './paginator/paginator';\r\nexport * from './normalizer/charMaps';\r\nexport * from './normalizer/normalizer';\r\nexport * from './enums/orderByDirection';\r\nexport * from './types/async';\r\nexport * from './types/cssProperties';\r\nexport * from './types/dictionaries';\r\nexport * from './types/enums';\r\nexport * from './types/functions';\r\nexport * from './types/pageable';\r\nexport * from './types/pagedData';\r\nexport * from './types/valueNamePair';\r\nexport * from './utils/async';\r\nexport * from './utils/common';\r\nexport * from './utils/lang';\r\nexport * from './utils/nameof';\r\nexport * from './decorators/bindThis.decorator';\r\nexport * from './decorators/callOnce.decorator';\r\nexport * from './decorators/debounceCall.decorator';\r\n"]}
|
|
@@ -11,10 +11,15 @@ export * from './paginator/paginator.mjs';
|
|
|
11
11
|
export * from './normalizer/charMaps.mjs';
|
|
12
12
|
export * from './normalizer/normalizer.mjs';
|
|
13
13
|
export * from './enums/orderByDirection.mjs';
|
|
14
|
+
export * from './types/async.mjs';
|
|
15
|
+
export * from './types/cssProperties.mjs';
|
|
14
16
|
export * from './types/dictionaries.mjs';
|
|
15
17
|
export * from './types/enums.mjs';
|
|
16
18
|
export * from './types/functions.mjs';
|
|
19
|
+
export * from './types/pageable.mjs';
|
|
20
|
+
export * from './types/pagedData.mjs';
|
|
17
21
|
export * from './types/valueNamePair.mjs';
|
|
22
|
+
export * from './utils/async.mjs';
|
|
18
23
|
export * from './utils/common.mjs';
|
|
19
24
|
export * from './utils/lang.mjs';
|
|
20
25
|
export * from './utils/nameof.mjs';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.mjs","sourceRoot":"","sources":["../../../src/types/async.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents pure value or value obtained by promise\n */\nexport type PromiseOr<TValue> = Promise<TValue>|TValue;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssProperties.mjs","sourceRoot":"","sources":["../../../src/types/cssProperties.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents css global values, usable for any css property\n */\nexport type CssGlobal = 'inherit'|'initial'|'revert'|'unset';\n\n/**\n * Represents css overflow values\n */\nexport type CssOverflow = 'visible'|'hidden'|'clip'|'scroll'|'auto'|'hidden visible'|CssGlobal;\n\n/**\n * Represents css position values\n */\nexport type CssPosition = 'static'|'relative'|'absolute'|'fixed'|'sticky'|CssGlobal;\n\n/**\n * Represents css display values\n */\nexport type CssDisplay = 'block'|'inline'|'run-in'|'flow'|'flow-root'|'table'|'flex'|'grid'|'list-item'|'table-row-group'|'table-header-group'|'table-footer-group'|'table-row'|'table-cell'|'table-column-group'|'table-column'|'table-caption'|'contents'|'none'|'inline-block'|'inline-list-item'|'inline-table'|'inline-flex'|'inline-grid'|CssGlobal;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaries.mjs","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string
|
|
1
|
+
{"version":3,"file":"dictionaries.mjs","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.mjs","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string}
|
|
1
|
+
{"version":3,"file":"enums.mjs","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.mjs","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageable.mjs","sourceRoot":"","sources":["../../../src/types/pageable.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for paging\n */\nexport interface Pageable\n{\n /**\n * Number of items that should be returned\n */\n size: number;\n\n /**\n * Page number that should be returned\n */\n page: number;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagedData.mjs","sourceRoot":"","sources":["../../../src/types/pagedData.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Representation of data that are paged\n */\nexport interface PagedData<TData = unknown>\n{\n /**\n * Reveived data\n */\n content: TData[];\n\n /**\n * Count of all available pages\n */\n totalPages: number;\n\n /**\n * Count of all items that are available\n */\n totalElements: number;\n\n /**\n * Indication that this page is last or not\n */\n last: boolean;\n\n /**\n * Requested number of items\n */\n size: number;\n\n /**\n * Requested page number\n */\n number: number;\n\n /**\n * Indication whether is this first page\n */\n first: boolean;\n\n /**\n * Number of returned items\n */\n numberOfElements: number;\n}"]}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.mjs","sourceRoot":"","sources":["../../../src/utils/async.ts"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,UAAgB,gBAAgB,CAAU,KAAyB;;QAErE,IAAG,KAAK,YAAY,OAAO,EAC3B;YACI,OAAO,MAAM,KAAK,CAAC;SACtB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CAAA","sourcesContent":["import {PromiseOr} from '../types/async';\n\n/**\n * Resolves `PromiseOr` value\n * @param value - Value to be solved\n */\nexport async function resolvePromiseOr<TResult>(value: PromiseOr<TResult>): Promise<TResult>\n{\n if(value instanceof Promise)\n {\n return await value;\n }\n\n return value;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `PromiseOr` value
|
|
4
|
+
* @param value - Value to be solved
|
|
5
|
+
*/
|
|
6
|
+
export function resolvePromiseOr(value) {
|
|
7
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
if (value instanceof Promise) {
|
|
9
|
+
return yield value;
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.mjs","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAIjC,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IAErC,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC;AAyED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,YAAuC,EAAE,GAAG,OAA0B;IAEzF,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IAErC,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAC9B;QACI,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,E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ACI,OAAO;KACV;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAE9B,IAAG,KAAK,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,EACvD;YACI,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;SAC5B;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import extendLib from 'extend';\r\n\r\nimport {isPresent} from './lang';\r\nimport {AsDictionary, Dictionary, StringDictionary} from '../types/dictionaries';\r\nimport {Enum} from '../types/enums';\r\nimport {ValueNamePair} from '../types/valueNamePair';\r\nimport {normalize} from '../normalizer/normalizer';\r\n\r\n/**\r\n * Reverse current string and returns new reverse string\r\n * @param str - String to be reversed\r\n * @returns string Reverse string\r\n */\r\nexport function reverseString(str: string): string\r\n{\r\n return str.split('').reverse().join('');\r\n}\r\n\r\n/**\r\n * Extends target object with source\r\n * @param deep - Indication whether deep copy should be performed\r\n * @param target - Object that will extended\r\n * @param source - Object that will be used for extending\r\n */\r\nexport function extend<T, U>(deep: boolean, target: T, source: U): T & U;\r\n/**\r\n * Extends target object with source objects\r\n * @param deep - Indication whether deep copy should be performed\r\n * @param target - Object that will extended\r\n * @param source1 - Object that will be used for extending\r\n * @param source2 - Object that will be used for extending\r\n */\r\nexport function extend<T, U, V>(deep: boolean, target: T, source1: U, source2: V): T & U & V;\r\n/**\r\n * Extends target object with source objects\r\n * @param deep - Indication whether deep copy should be performed\r\n * @param target - Object that will extended\r\n * @param source1 - Object that will be used for extending\r\n * @param source2 - Object that will be used for extending\r\n * @param source3 - Object that will be used for extending\r\n */\r\nexport function extend<T, U, V, W>(deep: boolean, target: T, source1: U, source2: V, source3: W): T & U & V & W;\r\n/**\r\n * Extends target object with source objects\r\n * @param deep - Indication whether deep copy should be performed\r\n * @param target - Object that will extended\r\n * @param source1 - Object that will be used for extending\r\n * @param source2 - Object that will be used for extending\r\n * @param source3 - Object that will be used for extending\r\n * @param source4 - Object that will be used for extending\r\n */\r\nexport function extend<T, U, V, W, X>(deep: boolean, target: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X;\r\n/**\r\n * Extends target object with source\r\n * @param target - Object that will extended\r\n * @param source - Object that will be used for extending\r\n */\r\nexport function extend<T, U>(target: T, source: U): T & U;\r\n/**\r\n * Extends target object with source\r\n * @param target - Object that will extended\r\n * @param source1 - Object that will be used for extending\r\n * @param source2 - Object that will be used for extending\r\n */\r\nexport function extend<T, U, V>(target: T, source1: U, source2: V): T & U & V;\r\n/**\r\n * Extends target object with source\r\n * @param target - Object that will extended\r\n * @param source1 - Object that will be used for extending\r\n * @param source2 - Object that will be used for extending\r\n * @param source3 - Object that will be used for extending\r\n */\r\nexport function extend<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;\r\n/**\r\n * Extends target object with source\r\n * @param target - Object that will extended\r\n * @param source1 - Object that will be used for extending\r\n * @param source2 - Object that will be used for extending\r\n * @param source3 - Object that will be used for extending\r\n * @param source4 - Object that will be used for extending\r\n */\r\nexport function extend<T, U, V, W, X>(target: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X;\r\n/**\r\n * Extends one object with additional properties from other objects, supports deep extend\r\n * @param deepOrObject - Object to be extended or indication that deep copy should be performed\r\n * @param objectN - Objects that will be used for extending, if deep is used first here is target object\r\n * @returns Object Extended object with properties from other objects\r\n */\r\nexport function extend<TResult>(deepOrObject: boolean | Dictionary<any>, ...objectN: Dictionary<any>[]): TResult;\r\n/**\r\n * Extends one object with additional properties from other objects, supports deep extend\r\n * @param deepOrObject - Object to be extended or indication that deep copy should be performed\r\n * @param objectN - Objects that will be used for extending, if deep is used first here is target object\r\n * @returns Object Extended object with properties from other objects\r\n */\r\nexport function extend(deepOrObject: boolean | Dictionary<any>, ...objectN: Dictionary<any>[]): Dictionary\r\n{\r\n return extendLib.apply(null, [deepOrObject, ...objectN]);\r\n}\r\n\r\n/**\r\n * Generates random string consisting from lowercase letters\r\n * @param length - Length of generated string\r\n * @returns number Generated string\r\n */\r\nexport function generateId(length: number): string\r\n{\r\n let result = '';\r\n\r\n for(let x = 0; x < length; x++)\r\n {\r\n result += String.fromCharCode(Math.round(Math.random() * 25 + 97));\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Generates random string of specified length from possible characters\r\n * @param length - Length of generated string\r\n * @param possible - Possible characters used for generation of string\r\n */\r\nexport function generateRandomString(length: number, possible: string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'): string\r\n{\r\n let text = '';\r\n\r\n for (let i = 0;i < length; i++)\r\n {\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n\r\n return text;\r\n}\r\n\r\n/**\r\n * Converts string in that way that first letter will be lowerCase\r\n * @param text - Text to be converted\r\n */\r\nexport function firstToLowerCase(text: string): string\r\n{\r\n return text.charAt(0).toLowerCase() + text.substr(1);\r\n}\r\n\r\n/**\r\n * Gets indication whether is child descendand of parent\r\n * @param parent - Parent to be tested\r\n * @param child - Child to be looked for\r\n */\r\nexport function isDescendant(parent: HTMLElement, child: HTMLElement): boolean\r\n{\r\n let node = child.parentNode;\r\n\r\n while (node != null)\r\n {\r\n if (node == parent)\r\n {\r\n return true;\r\n }\r\n\r\n node = node.parentNode;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Computes offset of element against document\r\n * @param element - Html element which offset is counted\r\n * @param doc - Html document to be used for extracting scroll offset\r\n */\r\nexport function offset(element: HTMLElement, doc?: Document)\r\n{\r\n doc = doc || document;\r\n\r\n const rect = element.getBoundingClientRect(),\r\n scrollLeft = window.pageXOffset || doc.documentElement.scrollLeft,\r\n scrollTop = window.pageYOffset || doc.documentElement.scrollTop;\r\n\r\n return {\r\n top: rect.top + scrollTop,\r\n left: rect.left + scrollLeft,\r\n bottom: rect.top + scrollTop + rect.height,\r\n right: rect.left + scrollLeft + rect.width\r\n };\r\n}\r\n\r\n/**\r\n * Converts html string into html DOM\r\n * @param html - Html string to be converted to DOM\r\n * @param doc - Optional html document to be used\r\n */\r\nexport function htmlToElement(html: string, doc?: Document): HTMLElement\r\n{\r\n let htmlDocument = document;\r\n\r\n if(isPresent(doc))\r\n {\r\n htmlDocument = doc;\r\n }\r\n\r\n const template = htmlDocument.createElement('template');\r\n html = html.trim();\r\n template.innerHTML = html;\r\n\r\n return template.content.firstChild as HTMLElement;\r\n}\r\n\r\n/**\r\n * Extract values from enum type\r\n * @param enumType - Enum type that will have extracted values\r\n */\r\nexport function getEnumValues<TEnum extends Enum>(enumType: TEnum): ValueNamePair[]\r\n{\r\n const result: ValueNamePair[] = [];\r\n\r\n Object.keys(enumType).forEach(key =>\r\n {\r\n if(isNaN(+key))\r\n {\r\n return;\r\n }\r\n\r\n result.push(\r\n {\r\n value: key,\r\n name: enumType[+key]\r\n });\r\n });\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Safely returns value from object property using string expression\r\n * @param object - Object which property value will be obtained\r\n * @param expression - Expression for obtaining value\r\n */\r\nexport function getValue<TValue = unknown>(object: Dictionary<any>, expression: string): TValue\r\nexport function getValue(object: Dictionary<any>, expression: string): unknown\r\n{\r\n return expression.split('.').reduce((o, i) =>\r\n {\r\n if(o)\r\n {\r\n return o[i];\r\n }\r\n\r\n return null;\r\n }, object);\r\n}\r\n\r\n/**\r\n * Sets value to objects property using string expression\r\n * @param object - Object which property value will be set\r\n * @param value - Value that will be set\r\n * @param expression - Expression for setting value\r\n */\r\nexport function setValue(object: Dictionary<any>, value: unknown, expression: string): void\r\n{\r\n const parts = expression.split('.');\r\n\r\n parts.forEach((part, index) =>\r\n {\r\n //last item value is assigned\r\n if(index == parts.length - 1)\r\n {\r\n if(isPresent(value))\r\n {\r\n object[part] = value;\r\n }\r\n\r\n return;\r\n }\r\n\r\n object = object[part] = object[part] ?? {};\r\n });\r\n}\r\n\r\n/**\r\n * Formats string using '%s', to print '%s' you have to use '%%s'\r\n * @param str - String containing substitution constants\r\n * @param args - Arguments that are used for replacement\r\n */\r\nexport function format(str: string, ...args: unknown[]): string\r\n{\r\n let i = 0;\r\n\r\n return str.replace(/((?!%).)%s/g, (_sub, substArgs) => `${substArgs[0]}${args[i++]}`).replace(/%%s/g, '%s');\r\n}\r\n\r\n/**\r\n * Performs flatMap over provided array\r\n * @param array - Array to be reduced using flatMap\r\n */\r\nexport function flatMapArray<TItem>(array: TItem[][]): TItem[]\r\n{\r\n return array.reduce((acc, x) => acc.concat(x), []);\r\n}\r\n\r\n/**\r\n * Serialize object to string that is usable as url query parameter\r\n * @param obj - Object to be serialized\r\n * @param replacer - Function that can be used for replacing provided values\r\n */\r\nexport function serializeToUrlQuery<TObj>(obj: TObj, replacer?: (this: any, key: string, value: any) => any): string\r\n{\r\n return btoa(encodeURIComponent(JSON.stringify(obj, replacer)));\r\n}\r\n\r\n/**\r\n * Deserialize value from url query string into object\r\n * @param queryParamValue - Query param string value\r\n * @param reviver - Function that can be used for correctly deserializing value\r\n */\r\nexport function deserializeFromUrlQuery<TObj>(queryParamValue: string, reviver?: (this: any, key: string, value: any) => any): TObj\r\n{\r\n return JSON.parse(decodeURIComponent(atob(queryParamValue)), reviver);\r\n}\r\n\r\n/**\r\n * Converts id to valid html id\r\n * @param id - Id that is going to be converted to valid html id\r\n * @param charMap - Character map used during normalization\r\n */\r\nexport function validHtmlId(id: string, charMap: StringDictionary = {}): string\r\n{\r\n id = id.toLowerCase()\r\n .replace(/[\\s]+/g, '-')\r\n .replace(/\\./g, '')\r\n .replace(/^(\\d)/g, 'x$1');\r\n\r\n id = normalize(id, charMap);\r\n\r\n return id;\r\n}\r\n\r\n/**\r\n * Checks whether is element overflown either horizontal, or vertical\r\n * @param element - Element to be tested for overflow\r\n */\r\nexport function isOverflown(element: HTMLElement): boolean\r\n{\r\n return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\r\n}\r\n\r\n/**\r\n * Normalizes string, removing accent\r\n * @param value - String to be normalized\r\n */\r\nexport function normalizeAccent(value: string): string\r\n{\r\n return value.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\r\n}\r\n\r\n/**\r\n * Converts instance of Class to equivalent Record type\r\n * @param instance - Instance which type to be converted\r\n * @typeparam TType - Type of instance\r\n */\r\nexport function asDictionary<TType>(instance: TType): AsDictionary<TType>\r\n{\r\n return instance as AsDictionary<TType>;\r\n}\r\n\r\n/**\r\n * Maps all iterable property values of object to \"this\" bounded\r\n * @param this - Object which will be filled with new values\r\n * @param value - Object holding values that will be used for filling\r\n * @param all - Indication whether map only existing properties or everything\r\n */\r\nexport function mapValuesToThis(this: Dictionary<any>, value: Dictionary<any>, all: boolean = false): void\r\n{\r\n if(!value)\r\n {\r\n return;\r\n }\r\n\r\n Object.keys(value).forEach(prop =>\r\n {\r\n if(value[prop] !== undefined && (all || (prop in this)))\r\n {\r\n this[prop] = value[prop];\r\n }\r\n });\r\n}\r\n"]}
|
|
@@ -206,4 +206,20 @@ export function normalizeAccent(value) {
|
|
|
206
206
|
export function asDictionary(instance) {
|
|
207
207
|
return instance;
|
|
208
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Maps all iterable property values of object to "this" bounded
|
|
211
|
+
* @param this - Object which will be filled with new values
|
|
212
|
+
* @param value - Object holding values that will be used for filling
|
|
213
|
+
* @param all - Indication whether map only existing properties or everything
|
|
214
|
+
*/
|
|
215
|
+
export function mapValuesToThis(value, all = false) {
|
|
216
|
+
if (!value) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
Object.keys(value).forEach(prop => {
|
|
220
|
+
if (value[prop] !== undefined && (all || (prop in this))) {
|
|
221
|
+
this[prop] = value[prop];
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
209
225
|
//# sourceMappingURL=common.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../rxjs/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC","sourcesContent":["export * from './types/async';\nexport * from './utils/async';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../../rxjs/src/types/async.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\n/**\n * Type that represents pure value or value obtained by promise or value obtained by Observable\n */\nexport type PromiseObservableOr<TValue> = Observable<TValue>|Promise<TValue>|TValue;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `PromiseObservableOr` value, if value is Observable then can be completed without value and undefined is resolved
|
|
4
|
+
* @param value - Value to be solved
|
|
5
|
+
*/
|
|
6
|
+
export function resolvePromiseObservableOr(value) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
if (value instanceof Observable) {
|
|
9
|
+
value = value
|
|
10
|
+
.toPromise();
|
|
11
|
+
}
|
|
12
|
+
if (value instanceof Promise) {
|
|
13
|
+
value
|
|
14
|
+
.then(resolve)
|
|
15
|
+
.catch(error => reject(error));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
resolve(value);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../../rxjs/src/utils/async.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAGhC;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAU,KAAmC;IAEnF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAEnC,IAAG,KAAK,YAAY,UAAU,EAC9B;YACI,KAAK,GAAG,KAAK;iBACR,SAAS,EAAE,CAAC;SACpB;QAED,IAAG,KAAK,YAAY,OAAO,EAC3B;YACI,KAAK;iBACA,IAAI,CAAC,OAAO,CAAC;iBACb,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAEnC,OAAO;SACV;QAED,OAAO,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import {Observable} from 'rxjs';\nimport {PromiseObservableOr} from '../types/async';\n\n/**\n * Resolves `PromiseObservableOr` value, if value is Observable then can be completed without value and undefined is resolved\n * @param value - Value to be solved\n */\nexport function resolvePromiseObservableOr<TResult>(value: PromiseObservableOr<TResult>): Promise<TResult|undefined>\n{\n return new Promise((resolve, reject) =>\n {\n if(value instanceof Observable)\n {\n value = value\n .toPromise();\n }\n\n if(value instanceof Promise)\n {\n value\n .then(resolve)\n .catch(error => reject(error));\n\n return;\n }\n \n resolve(value);\n });\n}\n"]}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,
|
|
1
|
+
{"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,10 +11,15 @@ export * from './paginator/paginator';
|
|
|
11
11
|
export * from './normalizer/charMaps';
|
|
12
12
|
export * from './normalizer/normalizer';
|
|
13
13
|
export * from './enums/orderByDirection';
|
|
14
|
+
export * from './types/async';
|
|
15
|
+
export * from './types/cssProperties';
|
|
14
16
|
export * from './types/dictionaries';
|
|
15
17
|
export * from './types/enums';
|
|
16
18
|
export * from './types/functions';
|
|
19
|
+
export * from './types/pageable';
|
|
20
|
+
export * from './types/pagedData';
|
|
17
21
|
export * from './types/valueNamePair';
|
|
22
|
+
export * from './utils/async';
|
|
18
23
|
export * from './utils/common';
|
|
19
24
|
export * from './utils/lang';
|
|
20
25
|
export * from './utils/nameof';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAErC,YAAY,CAAC,MAAM,CAAC,EAAE;IAElB,IAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAC/B;QACI,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;KAC/B;AACL,CAAC,CAAC,CAAC;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC","sourcesContent":["import {globalDefine} from './jsDevMode';\r\nimport {isBlank} from './utils/lang';\r\n\r\nglobalDefine(global =>\r\n{\r\n if(isBlank(global['jsDevMode']))\r\n {\r\n global['jsDevMode'] = false;\r\n }\r\n});\r\n\r\nexport * from './jsDevMode';\r\nexport * from './encoder/encoder';\r\nexport * from './paginator/paginator';\r\nexport * from './normalizer/charMaps';\r\nexport * from './normalizer/normalizer';\r\nexport * from './enums/orderByDirection';\r\nexport * from './types/async';\r\nexport * from './types/cssProperties';\r\nexport * from './types/dictionaries';\r\nexport * from './types/enums';\r\nexport * from './types/functions';\r\nexport * from './types/pageable';\r\nexport * from './types/pagedData';\r\nexport * from './types/valueNamePair';\r\nexport * from './utils/async';\r\nexport * from './utils/common';\r\nexport * from './utils/lang';\r\nexport * from './utils/nameof';\r\nexport * from './decorators/bindThis.decorator';\r\nexport * from './decorators/callOnce.decorator';\r\nexport * from './decorators/debounceCall.decorator';\r\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../src/types/async.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents pure value or value obtained by promise\n */\nexport type PromiseOr<TValue> = Promise<TValue>|TValue;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssProperties.js","sourceRoot":"","sources":["../../../src/types/cssProperties.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents css global values, usable for any css property\n */\nexport type CssGlobal = 'inherit'|'initial'|'revert'|'unset';\n\n/**\n * Represents css overflow values\n */\nexport type CssOverflow = 'visible'|'hidden'|'clip'|'scroll'|'auto'|'hidden visible'|CssGlobal;\n\n/**\n * Represents css position values\n */\nexport type CssPosition = 'static'|'relative'|'absolute'|'fixed'|'sticky'|CssGlobal;\n\n/**\n * Represents css display values\n */\nexport type CssDisplay = 'block'|'inline'|'run-in'|'flow'|'flow-root'|'table'|'flex'|'grid'|'list-item'|'table-row-group'|'table-header-group'|'table-footer-group'|'table-row'|'table-cell'|'table-column-group'|'table-column'|'table-caption'|'contents'|'none'|'inline-block'|'inline-list-item'|'inline-table'|'inline-flex'|'inline-grid'|CssGlobal;\n"]}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string
|
|
1
|
+
{"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string}
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageable.js","sourceRoot":"","sources":["../../../src/types/pageable.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for paging\n */\nexport interface Pageable\n{\n /**\n * Number of items that should be returned\n */\n size: number;\n\n /**\n * Page number that should be returned\n */\n page: number;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagedData.js","sourceRoot":"","sources":["../../../src/types/pagedData.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Representation of data that are paged\n */\nexport interface PagedData<TData = unknown>\n{\n /**\n * Reveived data\n */\n content: TData[];\n\n /**\n * Count of all available pages\n */\n totalPages: number;\n\n /**\n * Count of all items that are available\n */\n totalElements: number;\n\n /**\n * Indication that this page is last or not\n */\n last: boolean;\n\n /**\n * Requested number of items\n */\n size: number;\n\n /**\n * Requested page number\n */\n number: number;\n\n /**\n * Indication whether is this first page\n */\n first: boolean;\n\n /**\n * Number of returned items\n */\n numberOfElements: number;\n}"]}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `PromiseOr` value
|
|
4
|
+
* @param value - Value to be solved
|
|
5
|
+
*/
|
|
6
|
+
export function resolvePromiseOr(value) {
|
|
7
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
if (value instanceof Promise) {
|
|
9
|
+
return yield value;
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../src/utils/async.ts"],"names":[],"mappings":";AAEA;;;GAGG;AACH,MAAM,UAAgB,gBAAgB,CAAU,KAAyB;;QAErE,IAAG,KAAK,YAAY,OAAO,EAC3B;YACI,OAAO,MAAM,KAAK,CAAC;SACtB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CAAA","sourcesContent":["import {PromiseOr} from '../types/async';\n\n/**\n * Resolves `PromiseOr` value\n * @param value - Value to be solved\n */\nexport async function resolvePromiseOr<TResult>(value: PromiseOr<TResult>): Promise<TResult>\n{\n if(value instanceof Promise)\n {\n return await value;\n }\n\n return value;\n}\n"]}
|
|
@@ -206,4 +206,20 @@ export function normalizeAccent(value) {
|
|
|
206
206
|
export function asDictionary(instance) {
|
|
207
207
|
return instance;
|
|
208
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Maps all iterable property values of object to "this" bounded
|
|
211
|
+
* @param this - Object which will be filled with new values
|
|
212
|
+
* @param value - Object holding values that will be used for filling
|
|
213
|
+
* @param all - Indication whether map only existing properties or everything
|
|
214
|
+
*/
|
|
215
|
+
export function mapValuesToThis(value, all = false) {
|
|
216
|
+
if (!value) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
Object.keys(value).forEach(prop => {
|
|
220
|
+
if (value[prop] !== undefined && (all || (prop in this))) {
|
|
221
|
+
this[prop] = value[prop];
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
209
225
|
//# sourceMappingURL=common.js.map
|