@ngxs/store 3.7.6 → 3.8.0-dev.master-c341c15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/bundles/ngxs-store-internals-testing.umd.js +409 -420
  2. package/bundles/ngxs-store-internals-testing.umd.js.map +1 -1
  3. package/bundles/ngxs-store-internals.umd.js +48 -117
  4. package/bundles/ngxs-store-internals.umd.js.map +1 -1
  5. package/bundles/ngxs-store-operators.umd.js +62 -402
  6. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  7. package/bundles/ngxs-store.umd.js +1296 -3219
  8. package/bundles/ngxs-store.umd.js.map +1 -1
  9. package/esm2015/index.js +7 -7
  10. package/esm2015/internals/angular.js +1 -8
  11. package/esm2015/internals/index.js +2 -6
  12. package/esm2015/internals/initial-state.js +1 -21
  13. package/esm2015/internals/internal-tokens.js +4 -15
  14. package/esm2015/internals/memoize.js +8 -33
  15. package/esm2015/internals/ngxs-bootstrapper.js +7 -20
  16. package/esm2015/internals/ngxs-store-internals.js +2 -6
  17. package/esm2015/internals/src/symbols.js +2 -14
  18. package/esm2015/internals/symbols.js +2 -14
  19. package/esm2015/internals/testing/fresh-platform.js +13 -53
  20. package/esm2015/internals/testing/helpers/ngxs-test.component.js +11 -17
  21. package/esm2015/internals/testing/helpers/ngxs-test.module.js +13 -16
  22. package/esm2015/internals/testing/index.js +1 -5
  23. package/esm2015/internals/testing/ngxs-store-internals-testing.js +2 -6
  24. package/esm2015/internals/testing/ngxs.setup.js +1 -31
  25. package/esm2015/internals/testing/skip-console-logging.js +7 -42
  26. package/esm2015/internals/testing/symbol.js +2 -29
  27. package/esm2015/ngxs-store.js +2 -22
  28. package/esm2015/operators/append.js +7 -18
  29. package/esm2015/operators/compose.js +4 -22
  30. package/esm2015/operators/iif.js +12 -30
  31. package/esm2015/operators/index.js +2 -6
  32. package/esm2015/operators/insert-item.js +10 -22
  33. package/esm2015/operators/ngxs-store-operators.js +2 -6
  34. package/esm2015/operators/patch.js +5 -23
  35. package/esm2015/operators/remove-item.js +5 -17
  36. package/esm2015/operators/types.js +2 -0
  37. package/esm2015/operators/update-item.js +13 -25
  38. package/esm2015/operators/utils.js +1 -32
  39. package/esm2015/src/actions/actions.js +1 -18
  40. package/esm2015/src/actions/symbols.js +2 -39
  41. package/esm2015/src/actions-stream.js +20 -122
  42. package/esm2015/src/configs/messages.config.js +1 -44
  43. package/esm2015/src/decorators/action.js +3 -18
  44. package/esm2015/src/decorators/select/select-factory.js +10 -27
  45. package/esm2015/src/decorators/select/select.js +3 -22
  46. package/esm2015/src/decorators/select/symbols.js +4 -25
  47. package/esm2015/src/decorators/selector/selector.js +11 -38
  48. package/esm2015/src/decorators/selector/symbols.js +2 -5
  49. package/esm2015/src/decorators/selector-options.js +6 -19
  50. package/esm2015/src/decorators/state.js +5 -44
  51. package/esm2015/src/dev-features/ngxs-development.module.js +22 -0
  52. package/esm2015/src/dev-features/ngxs-unhandled-actions-logger.js +46 -0
  53. package/esm2015/src/dev-features/symbols.js +6 -0
  54. package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +10 -56
  55. package/esm2015/src/execution/internal-ngxs-execution-strategy.js +10 -32
  56. package/esm2015/src/execution/noop-ngxs-execution-strategy.js +7 -19
  57. package/esm2015/src/execution/symbols.js +3 -32
  58. package/esm2015/src/internal/custom-rxjs-subjects.js +81 -0
  59. package/esm2015/src/internal/dispatcher.js +26 -121
  60. package/esm2015/src/internal/error-handler.js +18 -72
  61. package/esm2015/src/internal/internals.js +24 -244
  62. package/esm2015/src/internal/lifecycle-state-manager.js +19 -117
  63. package/esm2015/src/internal/state-context-factory.js +8 -66
  64. package/esm2015/src/internal/state-factory.js +60 -227
  65. package/esm2015/src/internal/state-operations.js +19 -80
  66. package/esm2015/src/internal/state-operators.js +15 -28
  67. package/esm2015/src/internal/state-stream.js +9 -15
  68. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +7 -17
  69. package/esm2015/src/module.js +12 -47
  70. package/esm2015/src/modules/ngxs-feature.module.js +18 -36
  71. package/esm2015/src/modules/ngxs-root.module.js +18 -26
  72. package/esm2015/src/operators/leave-ngxs.js +8 -43
  73. package/esm2015/src/operators/of-action.js +16 -105
  74. package/esm2015/src/plugin-manager.js +17 -50
  75. package/esm2015/src/plugin_api.js +1 -5
  76. package/esm2015/src/private_api.js +3 -0
  77. package/esm2015/src/public_api.js +7 -9
  78. package/esm2015/src/public_to_deprecate.js +1 -51
  79. package/esm2015/src/selectors/create-model-selector.js +28 -0
  80. package/esm2015/src/selectors/create-pick-selector.js +14 -0
  81. package/esm2015/src/selectors/create-property-selectors.js +18 -0
  82. package/esm2015/src/selectors/create-selector.js +9 -0
  83. package/esm2015/src/selectors/index.js +6 -0
  84. package/esm2015/src/selectors/selector-checks.util.js +18 -0
  85. package/esm2015/src/selectors/selector-metadata.js +30 -0
  86. package/esm2015/src/selectors/selector-models.js +2 -0
  87. package/esm2015/src/selectors/selector-types.util.js +2 -0
  88. package/esm2015/src/selectors/selector-utils.js +74 -0
  89. package/esm2015/src/state-token/state-token.js +4 -32
  90. package/esm2015/src/state-token/symbols.js +2 -5
  91. package/esm2015/src/store.js +24 -108
  92. package/esm2015/src/symbols.js +7 -177
  93. package/esm2015/src/utils/compose.js +5 -23
  94. package/esm2015/src/utils/freeze.js +5 -20
  95. package/esm2015/src/utils/store-validators.js +3 -36
  96. package/esm2015/src/utils/utils.js +13 -64
  97. package/fesm2015/ngxs-store-internals-testing.js +38 -159
  98. package/fesm2015/ngxs-store-internals-testing.js.map +1 -1
  99. package/fesm2015/ngxs-store-internals.js +18 -100
  100. package/fesm2015/ngxs-store-internals.js.map +1 -1
  101. package/fesm2015/ngxs-store-operators.js +54 -186
  102. package/fesm2015/ngxs-store-operators.js.map +1 -1
  103. package/fesm2015/ngxs-store.js +662 -2488
  104. package/fesm2015/ngxs-store.js.map +1 -1
  105. package/index.d.ts +4 -0
  106. package/internals/index.d.ts +1 -1
  107. package/internals/internal-tokens.d.ts +2 -8
  108. package/internals/ngxs-bootstrapper.d.ts +4 -1
  109. package/internals/ngxs-store-internals.d.ts +1 -0
  110. package/internals/package.json +2 -5
  111. package/internals/testing/helpers/ngxs-test.component.d.ts +3 -0
  112. package/internals/testing/helpers/ngxs-test.module.d.ts +6 -0
  113. package/internals/testing/ngxs-store-internals-testing.d.ts +1 -0
  114. package/internals/testing/package.json +2 -5
  115. package/ngxs-store.d.ts +1 -17
  116. package/operators/append.d.ts +2 -3
  117. package/operators/compose.d.ts +2 -2
  118. package/operators/iif.d.ts +3 -4
  119. package/operators/index.d.ts +3 -2
  120. package/operators/insert-item.d.ts +2 -3
  121. package/operators/ngxs-store-operators.d.ts +1 -0
  122. package/operators/package.json +2 -5
  123. package/operators/patch.d.ts +5 -8
  124. package/operators/remove-item.d.ts +3 -4
  125. package/operators/types.d.ts +56 -0
  126. package/operators/update-item.d.ts +3 -4
  127. package/operators/utils.d.ts +2 -3
  128. package/package.json +4 -7
  129. package/src/actions/actions.d.ts +2 -2
  130. package/src/actions-stream.d.ts +8 -22
  131. package/src/decorators/select/select-factory.d.ts +3 -0
  132. package/src/decorators/selector/selector.d.ts +7 -2
  133. package/src/decorators/state.d.ts +1 -1
  134. package/src/dev-features/ngxs-development.module.d.ts +9 -0
  135. package/src/dev-features/ngxs-unhandled-actions-logger.d.ts +17 -0
  136. package/src/dev-features/symbols.d.ts +8 -0
  137. package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +3 -0
  138. package/src/execution/internal-ngxs-execution-strategy.d.ts +3 -0
  139. package/src/execution/noop-ngxs-execution-strategy.d.ts +3 -0
  140. package/src/internal/custom-rxjs-subjects.d.ts +37 -0
  141. package/src/internal/dispatcher.d.ts +5 -0
  142. package/src/internal/error-handler.d.ts +4 -1
  143. package/src/internal/lifecycle-state-manager.d.ts +3 -0
  144. package/src/internal/state-context-factory.d.ts +3 -0
  145. package/src/internal/state-factory.d.ts +7 -4
  146. package/src/internal/state-operations.d.ts +3 -0
  147. package/src/internal/state-operators.d.ts +2 -2
  148. package/src/internal/state-stream.d.ts +5 -2
  149. package/src/module.d.ts +4 -0
  150. package/src/modules/ngxs-feature.module.d.ts +4 -0
  151. package/src/modules/ngxs-root.module.d.ts +4 -0
  152. package/src/operators/of-action.d.ts +20 -7
  153. package/src/plugin-manager.d.ts +4 -1
  154. package/src/private_api.d.ts +2 -0
  155. package/src/public_api.d.ts +8 -5
  156. package/src/selectors/create-model-selector.d.ts +10 -0
  157. package/src/selectors/create-pick-selector.d.ts +6 -0
  158. package/src/selectors/create-property-selectors.d.ts +5 -0
  159. package/src/selectors/create-selector.d.ts +19 -0
  160. package/src/selectors/index.d.ts +5 -0
  161. package/src/selectors/selector-checks.util.d.ts +9 -0
  162. package/src/selectors/selector-metadata.d.ts +7 -0
  163. package/src/selectors/selector-models.d.ts +10 -0
  164. package/src/selectors/selector-types.util.d.ts +7 -0
  165. package/src/selectors/selector-utils.d.ts +9 -0
  166. package/src/store.d.ts +3 -0
  167. package/src/symbols.d.ts +7 -3
  168. package/src/utils/utils.d.ts +1 -1
  169. package/bundles/ngxs-store-internals-testing.umd.min.js +0 -16
  170. package/bundles/ngxs-store-internals-testing.umd.min.js.map +0 -1
  171. package/bundles/ngxs-store-internals.umd.min.js +0 -2
  172. package/bundles/ngxs-store-internals.umd.min.js.map +0 -1
  173. package/bundles/ngxs-store-operators.umd.min.js +0 -16
  174. package/bundles/ngxs-store-operators.umd.min.js.map +0 -1
  175. package/bundles/ngxs-store.umd.min.js +0 -16
  176. package/bundles/ngxs-store.umd.min.js.map +0 -1
  177. package/esm2015/operators/internals.js +0 -5
  178. package/esm2015/src/utils/selector-utils.js +0 -221
  179. package/esm5/index.js +0 -13
  180. package/esm5/internals/angular.js +0 -20
  181. package/esm5/internals/index.js +0 -10
  182. package/esm5/internals/initial-state.js +0 -45
  183. package/esm5/internals/internal-tokens.js +0 -16
  184. package/esm5/internals/memoize.js +0 -71
  185. package/esm5/internals/ngxs-bootstrapper.js +0 -56
  186. package/esm5/internals/ngxs-store-internals.js +0 -9
  187. package/esm5/internals/src/symbols.js +0 -14
  188. package/esm5/internals/symbols.js +0 -14
  189. package/esm5/internals/testing/fresh-platform.js +0 -121
  190. package/esm5/internals/testing/helpers/ngxs-test.component.js +0 -32
  191. package/esm5/internals/testing/helpers/ngxs-test.module.js +0 -32
  192. package/esm5/internals/testing/index.js +0 -8
  193. package/esm5/internals/testing/ngxs-store-internals-testing.js +0 -9
  194. package/esm5/internals/testing/ngxs.setup.js +0 -98
  195. package/esm5/internals/testing/skip-console-logging.js +0 -62
  196. package/esm5/internals/testing/symbol.js +0 -29
  197. package/esm5/ngxs-store.js +0 -25
  198. package/esm5/operators/append.js +0 -31
  199. package/esm5/operators/compose.js +0 -28
  200. package/esm5/operators/iif.js +0 -56
  201. package/esm5/operators/index.js +0 -18
  202. package/esm5/operators/insert-item.js +0 -41
  203. package/esm5/operators/internals.js +0 -5
  204. package/esm5/operators/ngxs-store-operators.js +0 -9
  205. package/esm5/operators/patch.js +0 -40
  206. package/esm5/operators/remove-item.js +0 -34
  207. package/esm5/operators/update-item.js +0 -52
  208. package/esm5/operators/utils.js +0 -50
  209. package/esm5/src/actions/actions.js +0 -62
  210. package/esm5/src/actions/symbols.js +0 -39
  211. package/esm5/src/actions-stream.js +0 -203
  212. package/esm5/src/configs/messages.config.js +0 -79
  213. package/esm5/src/decorators/action.js +0 -60
  214. package/esm5/src/decorators/select/select-factory.js +0 -46
  215. package/esm5/src/decorators/select/select.js +0 -50
  216. package/esm5/src/decorators/select/symbols.js +0 -51
  217. package/esm5/src/decorators/selector/selector.js +0 -59
  218. package/esm5/src/decorators/selector/symbols.js +0 -5
  219. package/esm5/src/decorators/selector-options.js +0 -34
  220. package/esm5/src/decorators/state.js +0 -78
  221. package/esm5/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +0 -123
  222. package/esm5/src/execution/internal-ngxs-execution-strategy.js +0 -54
  223. package/esm5/src/execution/noop-ngxs-execution-strategy.js +0 -43
  224. package/esm5/src/execution/symbols.js +0 -52
  225. package/esm5/src/internal/dispatcher.js +0 -231
  226. package/esm5/src/internal/error-handler.js +0 -125
  227. package/esm5/src/internal/internals.js +0 -470
  228. package/esm5/src/internal/lifecycle-state-manager.js +0 -224
  229. package/esm5/src/internal/state-context-factory.js +0 -135
  230. package/esm5/src/internal/state-factory.js +0 -583
  231. package/esm5/src/internal/state-operations.js +0 -134
  232. package/esm5/src/internal/state-operators.js +0 -34
  233. package/esm5/src/internal/state-stream.js +0 -37
  234. package/esm5/src/ivy/ivy-enabled-in-dev-mode.js +0 -28
  235. package/esm5/src/module.js +0 -202
  236. package/esm5/src/modules/ngxs-feature.module.js +0 -65
  237. package/esm5/src/modules/ngxs-root.module.js +0 -44
  238. package/esm5/src/operators/leave-ngxs.js +0 -58
  239. package/esm5/src/operators/of-action.js +0 -217
  240. package/esm5/src/plugin-manager.js +0 -82
  241. package/esm5/src/plugin_api.js +0 -10
  242. package/esm5/src/public_api.js +0 -29
  243. package/esm5/src/public_to_deprecate.js +0 -64
  244. package/esm5/src/state-token/state-token.js +0 -57
  245. package/esm5/src/state-token/symbols.js +0 -5
  246. package/esm5/src/store.js +0 -241
  247. package/esm5/src/symbols.js +0 -230
  248. package/esm5/src/utils/compose.js +0 -55
  249. package/esm5/src/utils/freeze.js +0 -35
  250. package/esm5/src/utils/selector-utils.js +0 -230
  251. package/esm5/src/utils/store-validators.js +0 -78
  252. package/esm5/src/utils/utils.js +0 -151
  253. package/fesm5/ngxs-store-internals-testing.js +0 -345
  254. package/fesm5/ngxs-store-internals-testing.js.map +0 -1
  255. package/fesm5/ngxs-store-internals.js +0 -217
  256. package/fesm5/ngxs-store-internals.js.map +0 -1
  257. package/fesm5/ngxs-store-operators.js +0 -340
  258. package/fesm5/ngxs-store-operators.js.map +0 -1
  259. package/fesm5/ngxs-store.js +0 -4619
  260. package/fesm5/ngxs-store.js.map +0 -1
  261. package/internals/ngxs-store-internals.metadata.json +0 -1
  262. package/internals/testing/ngxs-store-internals-testing.metadata.json +0 -1
  263. package/ngxs-store.metadata.json +0 -1
  264. package/operators/internals.d.ts +0 -2
  265. package/operators/ngxs-store-operators.metadata.json +0 -1
  266. package/src/utils/selector-utils.d.ts +0 -23
  267. package/types/index.d.ts +0 -2
@@ -1,489 +1,151 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define('@ngxs/store/operators', ['exports'], factory) :
4
- (global = global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs.store = global.ngxs.store || {}, global.ngxs.store.operators = {})));
5
- }(this, function (exports) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs.store = global.ngxs.store || {}, global.ngxs.store.operators = {})));
5
+ })(this, (function (exports) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- function __createBinding(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- o[k2] = m[k];
115
- }
116
-
117
- function __exportStar(m, exports) {
118
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
119
- }
120
-
121
- function __values(o) {
122
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
123
- if (m) return m.call(o);
124
- if (o && typeof o.length === "number") return {
125
- next: function () {
126
- if (o && i >= o.length) o = void 0;
127
- return { value: o && o[i++], done: !o };
128
- }
129
- };
130
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
- }
132
-
133
- function __read(o, n) {
134
- var m = typeof Symbol === "function" && o[Symbol.iterator];
135
- if (!m) return o;
136
- var i = m.call(o), r, ar = [], e;
137
- try {
138
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
139
- }
140
- catch (error) { e = { error: error }; }
141
- finally {
142
- try {
143
- if (r && !r.done && (m = i["return"])) m.call(i);
144
- }
145
- finally { if (e) throw e.error; }
146
- }
147
- return ar;
148
- }
149
-
150
- function __spread() {
151
- for (var ar = [], i = 0; i < arguments.length; i++)
152
- ar = ar.concat(__read(arguments[i]));
153
- return ar;
154
- }
155
-
156
- function __spreadArrays() {
157
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
- r[k] = a[j];
161
- return r;
162
- };
163
-
164
- function __await(v) {
165
- return this instanceof __await ? (this.v = v, this) : new __await(v);
166
- }
167
-
168
- function __asyncGenerator(thisArg, _arguments, generator) {
169
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
170
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
171
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
172
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
173
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
174
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
175
- function fulfill(value) { resume("next", value); }
176
- function reject(value) { resume("throw", value); }
177
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
178
- }
179
-
180
- function __asyncDelegator(o) {
181
- var i, p;
182
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
183
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
184
- }
185
-
186
- function __asyncValues(o) {
187
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
- var m = o[Symbol.asyncIterator], i;
189
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
190
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
191
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
192
- }
193
-
194
- function __makeTemplateObject(cooked, raw) {
195
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
196
- return cooked;
197
- };
198
-
199
- function __importStar(mod) {
200
- if (mod && mod.__esModule) return mod;
201
- var result = {};
202
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
- result.default = mod;
204
- return result;
205
- }
206
-
207
- function __importDefault(mod) {
208
- return (mod && mod.__esModule) ? mod : { default: mod };
209
- }
210
-
211
- function __classPrivateFieldGet(receiver, privateMap) {
212
- if (!privateMap.has(receiver)) {
213
- throw new TypeError("attempted to get private field on non-instance");
214
- }
215
- return privateMap.get(receiver);
216
- }
217
-
218
- function __classPrivateFieldSet(receiver, privateMap, value) {
219
- if (!privateMap.has(receiver)) {
220
- throw new TypeError("attempted to set private field on non-instance");
221
- }
222
- privateMap.set(receiver, value);
223
- return value;
224
- }
225
-
226
- /**
227
- * @fileoverview added by tsickle
228
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
229
- */
230
7
  /**
231
- * @template T
232
- * @param {?} items - Specific items to append to the end of an array
233
- * @return {?}
8
+ * @param items - Specific items to append to the end of an array
234
9
  */
235
10
  function append(items) {
236
- return (/**
237
- * @param {?} existing
238
- * @return {?}
239
- */
240
- function appendOperator(existing) {
11
+ return function appendOperator(existing) {
241
12
  // If `items` is `undefined` or `null` or `[]` but `existing` is provided
242
13
  // just return `existing`
243
- /** @type {?} */
244
14
  var itemsNotProvidedButExistingIs = (!items || !items.length) && existing;
245
15
  if (itemsNotProvidedButExistingIs) {
246
- return (/** @type {?} */ (existing));
16
+ return existing;
247
17
  }
248
18
  if (Array.isArray(existing)) {
249
- return existing.concat((/** @type {?} */ (items)));
19
+ return existing.concat(items);
250
20
  }
251
21
  // For example if some property is added dynamically
252
22
  // and didn't exist before thus it's not `ArrayLike`
253
- return (/** @type {?} */ (items));
254
- });
23
+ return items;
24
+ };
255
25
  }
256
26
 
257
- /**
258
- * @fileoverview added by tsickle
259
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
260
- */
261
- /**
262
- * @template T
263
- * @param {...?} operators
264
- * @return {?}
265
- */
266
27
  function compose() {
267
28
  var operators = [];
268
29
  for (var _i = 0; _i < arguments.length; _i++) {
269
30
  operators[_i] = arguments[_i];
270
31
  }
271
- return (/**
272
- * @param {?} existing
273
- * @return {?}
274
- */
275
- function composeOperator(existing) {
276
- return operators.reduce((/**
277
- * @param {?} accumulator
278
- * @param {?} operator
279
- * @return {?}
280
- */
281
- function (accumulator, operator) { return operator(accumulator); }), existing);
282
- });
32
+ return function composeOperator(existing) {
33
+ return operators.reduce(function (accumulator, operator) { return operator(accumulator); }, existing);
34
+ };
283
35
  }
284
36
 
285
- /**
286
- * @fileoverview added by tsickle
287
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
288
- */
289
- /**
290
- * @template T
291
- * @param {?} value
292
- * @return {?}
293
- */
294
37
  function isStateOperator(value) {
295
38
  return typeof value === 'function';
296
39
  }
297
- /**
298
- * @param {?} value
299
- * @return {?}
300
- */
301
40
  function isUndefined(value) {
302
41
  return typeof value === 'undefined';
303
42
  }
304
- /**
305
- * @template T
306
- * @param {?} value
307
- * @return {?}
308
- */
309
43
  function isPredicate(value) {
310
44
  return typeof value === 'function';
311
45
  }
312
- /**
313
- * @param {?} value
314
- * @return {?}
315
- */
316
46
  function isNumber(value) {
317
47
  return typeof value === 'number';
318
48
  }
319
- /**
320
- * @param {?} index
321
- * @return {?}
322
- */
323
49
  function invalidIndex(index) {
324
50
  return Number.isNaN(index) || index === -1;
325
51
  }
326
- /**
327
- * @template T
328
- * @param {?} value
329
- * @return {?}
330
- */
331
52
  function isNil(value) {
332
53
  return value === null || isUndefined(value);
333
54
  }
334
55
 
335
- /**
336
- * @fileoverview added by tsickle
337
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
338
- */
339
- /**
340
- * @template T
341
- * @param {?} operatorOrValue
342
- * @param {?=} existing
343
- * @return {?}
344
- */
345
56
  function retrieveValue(operatorOrValue, existing) {
346
57
  // If state operator is a function
347
58
  // then call it with an original value
348
59
  if (isStateOperator(operatorOrValue)) {
349
- /** @type {?} */
350
- var value = operatorOrValue((/** @type {?} */ ((/** @type {?} */ (existing)))));
351
- return (/** @type {?} */ (value));
60
+ var value = operatorOrValue(existing);
61
+ return value;
352
62
  }
353
63
  // If operator or value was not provided
354
64
  // e.g. `elseOperatorOrValue` is `undefined`
355
65
  // then we just return an original value
356
66
  if (isUndefined(operatorOrValue)) {
357
- return (/** @type {?} */ ((/** @type {?} */ (((/** @type {?} */ (existing)))))));
67
+ return existing;
358
68
  }
359
- return (/** @type {?} */ (operatorOrValue));
69
+ return operatorOrValue;
360
70
  }
361
71
  /**
362
- * @template T
363
- * @param {?} condition - Condition can be a plain boolean value or a function,
72
+ * @param condition - Condition can be a plain boolean value or a function,
364
73
  * that returns boolean, also this function can take a value as an argument
365
74
  * to which this state operator applies
366
- * @param {?} trueOperatorOrValue - Any value or a state operator
367
- * @param {?=} elseOperatorOrValue - Any value or a state operator
368
- * @return {?}
75
+ * @param trueOperatorOrValue - Any value or a state operator
76
+ * @param elseOperatorOrValue - Any value or a state operator
369
77
  */
370
78
  function iif(condition, trueOperatorOrValue, elseOperatorOrValue) {
371
- return (/**
372
- * @param {?} existing
373
- * @return {?}
374
- */
375
- function iifOperator(existing) {
79
+ return function iifOperator(existing) {
376
80
  // Convert the value to a boolean
377
- /** @type {?} */
378
81
  var result = !!condition;
379
82
  // but if it is a function then run it to get the result
380
83
  if (isPredicate(condition)) {
381
84
  result = condition(existing);
382
85
  }
383
86
  if (result) {
384
- return retrieveValue(trueOperatorOrValue, (/** @type {?} */ (existing)));
87
+ return retrieveValue(trueOperatorOrValue, existing);
385
88
  }
386
- return retrieveValue((/** @type {?} */ (elseOperatorOrValue)), (/** @type {?} */ (existing)));
387
- });
89
+ return retrieveValue(elseOperatorOrValue, existing);
90
+ };
388
91
  }
389
92
 
390
93
  /**
391
- * @fileoverview added by tsickle
392
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
393
- */
394
- /**
395
- * @template T
396
- * @param {?} value - Value to insert
397
- * @param {?=} beforePosition
398
- * @return {?}
94
+ * @param value - Value to insert
95
+ * @param [beforePosition] - Specified index to insert value before, optional
399
96
  */
400
97
  function insertItem(value, beforePosition) {
401
- return (/**
402
- * @param {?} existing
403
- * @return {?}
404
- */
405
- function insertItemOperator(existing) {
98
+ return function insertItemOperator(existing) {
406
99
  // Have to check explicitly for `null` and `undefined`
407
100
  // because `value` can be `0`, thus `!value` will return `true`
408
101
  if (isNil(value) && existing) {
409
- return (/** @type {?} */ (existing));
102
+ return existing;
410
103
  }
411
104
  // Property may be dynamic and might not existed before
412
105
  if (!Array.isArray(existing)) {
413
- return [(/** @type {?} */ (value))];
106
+ return [value];
414
107
  }
415
- /** @type {?} */
416
108
  var clone = existing.slice();
417
- /** @type {?} */
418
109
  var index = 0;
419
110
  // No need to call `isNumber`
420
111
  // as we are checking `> 0` not `>= 0`
421
112
  // everything except number will return false here
422
- if ((/** @type {?} */ (beforePosition)) > 0) {
423
- index = (/** @type {?} */ (beforePosition));
113
+ if (beforePosition > 0) {
114
+ index = beforePosition;
424
115
  }
425
- clone.splice(index, 0, (/** @type {?} */ (value)));
116
+ clone.splice(index, 0, value);
426
117
  return clone;
427
- });
118
+ };
428
119
  }
429
120
 
430
- /**
431
- * @fileoverview added by tsickle
432
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
433
- */
434
- /**
435
- * @template T
436
- * @param {?} patchObject
437
- * @return {?}
438
- */
439
121
  function patch(patchObject) {
440
- return (/**
441
- * @template U
442
- * @param {?} existing
443
- * @return {?}
444
- */
445
- function patchStateOperator(existing) {
446
- /** @type {?} */
122
+ return function patchStateOperator(existing) {
447
123
  var clone = null;
448
124
  for (var k in patchObject) {
449
- /** @type {?} */
450
125
  var newValue = patchObject[k];
451
- /** @type {?} */
452
126
  var existingPropValue = existing[k];
453
- /** @type {?} */
454
127
  var newPropValue = isStateOperator(newValue)
455
- ? newValue((/** @type {?} */ (existingPropValue)))
128
+ ? newValue(existingPropValue)
456
129
  : newValue;
457
130
  if (newPropValue !== existingPropValue) {
458
131
  if (!clone) {
459
- clone = __assign({}, ((/** @type {?} */ (existing))));
132
+ clone = Object.assign({}, existing);
460
133
  }
461
134
  clone[k] = newPropValue;
462
135
  }
463
136
  }
464
137
  return clone || existing;
465
- });
138
+ };
466
139
  }
467
140
 
468
141
  /**
469
- * @fileoverview added by tsickle
470
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
471
- */
472
- /**
473
- * @template T
474
- * @param {?} selector - Index of item in the array or a predicate function
142
+ * @param selector - Index of item in the array or a predicate function
475
143
  * that can be provided in `Array.prototype.findIndex`
476
- * @param {?} operatorOrValue - New value under the `selector` index or a
144
+ * @param operatorOrValue - New value under the `selector` index or a
477
145
  * function that can be applied to an existing value
478
- * @return {?}
479
146
  */
480
147
  function updateItem(selector, operatorOrValue) {
481
- return (/**
482
- * @param {?} existing
483
- * @return {?}
484
- */
485
- function updateItemOperator(existing) {
486
- /** @type {?} */
148
+ return function updateItemOperator(existing) {
487
149
  var index = -1;
488
150
  if (isPredicate(selector)) {
489
151
  index = existing.findIndex(selector);
@@ -492,46 +154,34 @@
492
154
  index = selector;
493
155
  }
494
156
  if (invalidIndex(index)) {
495
- return (/** @type {?} */ (existing));
157
+ return existing;
496
158
  }
497
- /** @type {?} */
498
- var value = (/** @type {?} */ (null));
159
+ var value = null;
499
160
  // Need to check if the new item value will change the existing item value
500
161
  // then, only if it will change it then clone the array and set the item
501
- if (isStateOperator(operatorOrValue)) {
502
- value = operatorOrValue((/** @type {?} */ (existing[index])));
162
+ var theOperatorOrValue = operatorOrValue;
163
+ if (isStateOperator(theOperatorOrValue)) {
164
+ value = theOperatorOrValue(existing[index]);
503
165
  }
504
166
  else {
505
- value = operatorOrValue;
167
+ value = theOperatorOrValue;
506
168
  }
507
169
  // If the value hasn't been mutated
508
170
  // then we just return `existing` array
509
171
  if (value === existing[index]) {
510
- return (/** @type {?} */ (existing));
172
+ return existing;
511
173
  }
512
- /** @type {?} */
513
174
  var clone = existing.slice();
514
- clone[index] = (/** @type {?} */ (value));
175
+ clone[index] = value;
515
176
  return clone;
516
- });
177
+ };
517
178
  }
518
179
 
519
180
  /**
520
- * @fileoverview added by tsickle
521
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
522
- */
523
- /**
524
- * @template T
525
- * @param {?} selector - index or predicate to remove an item from an array by
526
- * @return {?}
181
+ * @param selector - index or predicate to remove an item from an array by
527
182
  */
528
183
  function removeItem(selector) {
529
- return (/**
530
- * @param {?} existing
531
- * @return {?}
532
- */
533
- function removeItemOperator(existing) {
534
- /** @type {?} */
184
+ return function removeItemOperator(existing) {
535
185
  var index = -1;
536
186
  if (isPredicate(selector)) {
537
187
  index = existing.findIndex(selector);
@@ -540,19 +190,29 @@
540
190
  index = selector;
541
191
  }
542
192
  if (invalidIndex(index)) {
543
- return (/** @type {?} */ (existing));
193
+ return existing;
544
194
  }
545
- /** @type {?} */
546
195
  var clone = existing.slice();
547
196
  clone.splice(index, 1);
548
197
  return clone;
549
- });
198
+ };
550
199
  }
551
200
 
201
+ /**
202
+ * @module
203
+ * @description
204
+ * Entry point for all public APIs of this package.
205
+ */
206
+
207
+ /**
208
+ * Generated bundle index. Do not edit.
209
+ */
210
+
552
211
  exports.append = append;
553
212
  exports.compose = compose;
554
213
  exports.iif = iif;
555
214
  exports.insertItem = insertItem;
215
+ exports.isPredicate = isPredicate;
556
216
  exports.isStateOperator = isStateOperator;
557
217
  exports.patch = patch;
558
218
  exports.removeItem = removeItem;