@firestitch/common 8.0.12 → 8.0.13

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 (303) hide show
  1. package/app/directives/autofocus.directive.d.ts +6 -6
  2. package/app/directives/prevent-default.directive.d.ts +3 -3
  3. package/app/directives/stop-propagation.directive.d.ts +3 -3
  4. package/app/fs-common.module.d.ts +4 -4
  5. package/app/pipes/bytes.pipe.d.ts +4 -4
  6. package/app/pipes/currency.pipe.d.ts +6 -6
  7. package/app/pipes/number.pipe.d.ts +4 -4
  8. package/app/pipes/ordinal-number.pipe.d.ts +4 -4
  9. package/app/pipes/truncate.pipe.d.ts +5 -5
  10. package/app/pipes/util.pipe.d.ts +15 -15
  11. package/app/services/array.service.d.ts +58 -58
  12. package/app/services/math.service.d.ts +6 -6
  13. package/app/services/util.service.d.ts +86 -86
  14. package/app/services/vaildate.service.d.ts +13 -13
  15. package/bundles/firestitch-common.umd.js +3144 -3143
  16. package/bundles/firestitch-common.umd.js.map +1 -1
  17. package/bundles/firestitch-common.umd.min.js +1 -1
  18. package/bundles/firestitch-common.umd.min.js.map +1 -1
  19. package/esm2015/app/directives/autofocus.directive.js +41 -41
  20. package/esm2015/app/directives/prevent-default.directive.js +23 -23
  21. package/esm2015/app/directives/stop-propagation.directive.js +23 -23
  22. package/esm2015/app/fs-common.module.js +71 -71
  23. package/esm2015/app/pipes/bytes.pipe.js +21 -21
  24. package/esm2015/app/pipes/currency.pipe.js +37 -37
  25. package/esm2015/app/pipes/number.pipe.js +22 -22
  26. package/esm2015/app/pipes/ordinal-number.pipe.js +21 -21
  27. package/esm2015/app/pipes/truncate.pipe.js +27 -27
  28. package/esm2015/app/pipes/util.pipe.js +70 -70
  29. package/esm2015/app/services/array.service.js +351 -351
  30. package/esm2015/app/services/math.service.js +28 -28
  31. package/esm2015/app/services/util.service.js +429 -429
  32. package/esm2015/app/services/vaildate.service.js +47 -47
  33. package/esm2015/firestitch-common.js +18 -18
  34. package/esm2015/libs/array/compare/compare.js +18 -18
  35. package/esm2015/libs/array/compare/index.js +6 -6
  36. package/esm2015/libs/array/filter/filter.js +52 -52
  37. package/esm2015/libs/array/filter/index.js +6 -6
  38. package/esm2015/libs/array/find/find.js +16 -16
  39. package/esm2015/libs/array/find/index.js +6 -6
  40. package/esm2015/libs/array/inArray/inArray.js +21 -21
  41. package/esm2015/libs/array/inArray/index.js +6 -6
  42. package/esm2015/libs/array/index/index.js +24 -24
  43. package/esm2015/libs/array/index.js +18 -18
  44. package/esm2015/libs/array/indexOf/index.js +6 -6
  45. package/esm2015/libs/array/indexOf/indexOf.js +30 -30
  46. package/esm2015/libs/array/keyExists/index.js +6 -6
  47. package/esm2015/libs/array/keyExists/keyExists.js +13 -13
  48. package/esm2015/libs/array/ksort/index.js +6 -6
  49. package/esm2015/libs/array/ksort/ksort.js +21 -21
  50. package/esm2015/libs/array/list/index.js +6 -6
  51. package/esm2015/libs/array/list/list.js +29 -29
  52. package/esm2015/libs/array/nameValue/index.js +6 -6
  53. package/esm2015/libs/array/nameValue/nameValue.js +51 -51
  54. package/esm2015/libs/array/remove/index.js +6 -6
  55. package/esm2015/libs/array/remove/remove.js +19 -19
  56. package/esm2015/libs/array/rsort/index.js +6 -6
  57. package/esm2015/libs/array/rsort/rsort.js +14 -14
  58. package/esm2015/libs/array/sort/index.js +6 -6
  59. package/esm2015/libs/array/sort/sort.js +43 -43
  60. package/esm2015/libs/format/acronym/acronym.js +33 -33
  61. package/esm2015/libs/format/acronym/index.js +6 -6
  62. package/esm2015/libs/format/bytes/bytes.js +22 -22
  63. package/esm2015/libs/format/bytes/index.js +6 -6
  64. package/esm2015/libs/format/currency/currency.js +19 -19
  65. package/esm2015/libs/format/currency/index.js +6 -6
  66. package/esm2015/libs/format/index.js +10 -10
  67. package/esm2015/libs/format/number/index.js +6 -6
  68. package/esm2015/libs/format/number/number.js +13 -13
  69. package/esm2015/libs/format/truncate/index.js +6 -6
  70. package/esm2015/libs/format/truncate/truncate.js +24 -24
  71. package/esm2015/libs/index.js +10 -10
  72. package/esm2015/libs/rxjs/delayedRetry.js +57 -57
  73. package/esm2015/libs/util/boolean/boolean.js +13 -13
  74. package/esm2015/libs/util/boolean/index.js +6 -6
  75. package/esm2015/libs/util/debounce/debounce.js +39 -39
  76. package/esm2015/libs/util/debounce/index.js +6 -6
  77. package/esm2015/libs/util/get-normalized-path/get-normalized-path.js +15 -15
  78. package/esm2015/libs/util/get-normalized-path/index.js +6 -6
  79. package/esm2015/libs/util/guid/guid.js +35 -35
  80. package/esm2015/libs/util/guid/index.js +6 -6
  81. package/esm2015/libs/util/index.js +22 -22
  82. package/esm2015/libs/util/isClass/index.js +6 -6
  83. package/esm2015/libs/util/isClass/isClass.js +27 -27
  84. package/esm2015/libs/util/isEmpty/index.js +6 -6
  85. package/esm2015/libs/util/isEmpty/isEmpty.js +22 -22
  86. package/esm2015/libs/util/isNumeric/index.js +6 -6
  87. package/esm2015/libs/util/isNumeric/isNumeric.js +15 -15
  88. package/esm2015/libs/util/keys/index.js +6 -6
  89. package/esm2015/libs/util/keys/keys.js +79 -79
  90. package/esm2015/libs/util/length/index.js +6 -6
  91. package/esm2015/libs/util/length/length.js +19 -19
  92. package/esm2015/libs/util/ordinal-number/ordinal-number.js +19 -19
  93. package/esm2015/libs/util/queue/index.js +7 -7
  94. package/esm2015/libs/util/queue/operation.js +31 -31
  95. package/esm2015/libs/util/queue/queue.enum.js +11 -11
  96. package/esm2015/libs/util/queue/queue.js +290 -290
  97. package/esm2015/libs/util/remove-query-params/index.js +6 -6
  98. package/esm2015/libs/util/remove-query-params/remove-query-params.js +12 -12
  99. package/esm2015/libs/util/resolve/index.js +6 -6
  100. package/esm2015/libs/util/resolve/resolve.js +32 -32
  101. package/esm2015/libs/util/stringify/index.js +6 -6
  102. package/esm2015/libs/util/stringify/stringify.js +12 -12
  103. package/esm2015/libs/util/throttle/index.js +6 -6
  104. package/esm2015/libs/util/throttle/throttle.js +29 -29
  105. package/esm2015/libs/util/uuid/index.js +6 -6
  106. package/esm2015/libs/util/uuid/uuid.js +12 -12
  107. package/esm2015/libs/util/value/index.js +6 -6
  108. package/esm2015/libs/util/value/value.js +19 -19
  109. package/esm2015/libs/validate/email/email.js +12 -12
  110. package/esm2015/libs/validate/email/index.js +6 -6
  111. package/esm2015/libs/validate/index.js +8 -8
  112. package/esm2015/libs/validate/phone/index.js +6 -6
  113. package/esm2015/libs/validate/phone/phone.js +14 -14
  114. package/esm2015/libs/validate/url/index.js +6 -6
  115. package/esm2015/libs/validate/url/url.js +22 -22
  116. package/esm2015/public_api.js +16 -16
  117. package/esm5/app/directives/autofocus.directive.js +44 -44
  118. package/esm5/app/directives/prevent-default.directive.js +31 -31
  119. package/esm5/app/directives/stop-propagation.directive.js +31 -31
  120. package/esm5/app/fs-common.module.js +78 -78
  121. package/esm5/app/pipes/bytes.pipe.js +29 -29
  122. package/esm5/app/pipes/currency.pipe.js +42 -42
  123. package/esm5/app/pipes/number.pipe.js +31 -31
  124. package/esm5/app/pipes/ordinal-number.pipe.js +29 -29
  125. package/esm5/app/pipes/truncate.pipe.js +37 -37
  126. package/esm5/app/pipes/util.pipe.js +99 -99
  127. package/esm5/app/services/array.service.js +490 -490
  128. package/esm5/app/services/math.service.js +41 -41
  129. package/esm5/app/services/util.service.js +607 -607
  130. package/esm5/app/services/vaildate.service.js +62 -62
  131. package/esm5/firestitch-common.js +18 -18
  132. package/esm5/libs/array/compare/compare.js +18 -18
  133. package/esm5/libs/array/compare/index.js +6 -6
  134. package/esm5/libs/array/filter/filter.js +52 -52
  135. package/esm5/libs/array/filter/index.js +6 -6
  136. package/esm5/libs/array/find/find.js +16 -16
  137. package/esm5/libs/array/find/index.js +6 -6
  138. package/esm5/libs/array/inArray/inArray.js +21 -21
  139. package/esm5/libs/array/inArray/index.js +6 -6
  140. package/esm5/libs/array/index/index.js +25 -24
  141. package/esm5/libs/array/index.js +18 -18
  142. package/esm5/libs/array/indexOf/index.js +6 -6
  143. package/esm5/libs/array/indexOf/indexOf.js +30 -30
  144. package/esm5/libs/array/keyExists/index.js +6 -6
  145. package/esm5/libs/array/keyExists/keyExists.js +13 -13
  146. package/esm5/libs/array/ksort/index.js +6 -6
  147. package/esm5/libs/array/ksort/ksort.js +21 -21
  148. package/esm5/libs/array/list/index.js +6 -6
  149. package/esm5/libs/array/list/list.js +30 -30
  150. package/esm5/libs/array/nameValue/index.js +6 -6
  151. package/esm5/libs/array/nameValue/nameValue.js +51 -51
  152. package/esm5/libs/array/remove/index.js +6 -6
  153. package/esm5/libs/array/remove/remove.js +19 -19
  154. package/esm5/libs/array/rsort/index.js +6 -6
  155. package/esm5/libs/array/rsort/rsort.js +14 -14
  156. package/esm5/libs/array/sort/index.js +6 -6
  157. package/esm5/libs/array/sort/sort.js +44 -44
  158. package/esm5/libs/format/acronym/acronym.js +34 -34
  159. package/esm5/libs/format/acronym/index.js +6 -6
  160. package/esm5/libs/format/bytes/bytes.js +22 -22
  161. package/esm5/libs/format/bytes/index.js +6 -6
  162. package/esm5/libs/format/currency/currency.js +22 -22
  163. package/esm5/libs/format/currency/index.js +6 -6
  164. package/esm5/libs/format/index.js +10 -10
  165. package/esm5/libs/format/number/index.js +6 -6
  166. package/esm5/libs/format/number/number.js +13 -13
  167. package/esm5/libs/format/truncate/index.js +6 -6
  168. package/esm5/libs/format/truncate/truncate.js +27 -27
  169. package/esm5/libs/index.js +10 -10
  170. package/esm5/libs/rxjs/delayedRetry.js +64 -64
  171. package/esm5/libs/util/boolean/boolean.js +13 -13
  172. package/esm5/libs/util/boolean/index.js +6 -6
  173. package/esm5/libs/util/debounce/debounce.js +39 -39
  174. package/esm5/libs/util/debounce/index.js +6 -6
  175. package/esm5/libs/util/get-normalized-path/get-normalized-path.js +15 -15
  176. package/esm5/libs/util/get-normalized-path/index.js +6 -6
  177. package/esm5/libs/util/guid/guid.js +36 -36
  178. package/esm5/libs/util/guid/index.js +6 -6
  179. package/esm5/libs/util/index.js +22 -22
  180. package/esm5/libs/util/isClass/index.js +6 -6
  181. package/esm5/libs/util/isClass/isClass.js +27 -27
  182. package/esm5/libs/util/isEmpty/index.js +6 -6
  183. package/esm5/libs/util/isEmpty/isEmpty.js +22 -22
  184. package/esm5/libs/util/isNumeric/index.js +6 -6
  185. package/esm5/libs/util/isNumeric/isNumeric.js +15 -15
  186. package/esm5/libs/util/keys/index.js +6 -6
  187. package/esm5/libs/util/keys/keys.js +79 -79
  188. package/esm5/libs/util/length/index.js +6 -6
  189. package/esm5/libs/util/length/length.js +19 -19
  190. package/esm5/libs/util/ordinal-number/ordinal-number.js +21 -21
  191. package/esm5/libs/util/queue/index.js +7 -7
  192. package/esm5/libs/util/queue/operation.js +29 -29
  193. package/esm5/libs/util/queue/queue.enum.js +11 -11
  194. package/esm5/libs/util/queue/queue.js +366 -366
  195. package/esm5/libs/util/remove-query-params/index.js +6 -6
  196. package/esm5/libs/util/remove-query-params/remove-query-params.js +12 -12
  197. package/esm5/libs/util/resolve/index.js +6 -6
  198. package/esm5/libs/util/resolve/resolve.js +33 -33
  199. package/esm5/libs/util/stringify/index.js +6 -6
  200. package/esm5/libs/util/stringify/stringify.js +12 -12
  201. package/esm5/libs/util/throttle/index.js +6 -6
  202. package/esm5/libs/util/throttle/throttle.js +29 -29
  203. package/esm5/libs/util/uuid/index.js +6 -6
  204. package/esm5/libs/util/uuid/uuid.js +12 -12
  205. package/esm5/libs/util/value/index.js +6 -6
  206. package/esm5/libs/util/value/value.js +19 -19
  207. package/esm5/libs/validate/email/email.js +12 -12
  208. package/esm5/libs/validate/email/index.js +6 -6
  209. package/esm5/libs/validate/index.js +8 -8
  210. package/esm5/libs/validate/phone/index.js +6 -6
  211. package/esm5/libs/validate/phone/phone.js +14 -14
  212. package/esm5/libs/validate/url/index.js +6 -6
  213. package/esm5/libs/validate/url/url.js +22 -22
  214. package/esm5/public_api.js +16 -16
  215. package/fesm2015/firestitch-common.js +2641 -2641
  216. package/fesm2015/firestitch-common.js.map +1 -1
  217. package/fesm5/firestitch-common.js +3156 -3155
  218. package/fesm5/firestitch-common.js.map +1 -1
  219. package/firestitch-common.d.ts +13 -13
  220. package/libs/array/compare/compare.d.ts +1 -1
  221. package/libs/array/compare/index.d.ts +1 -1
  222. package/libs/array/filter/filter.d.ts +1 -1
  223. package/libs/array/filter/index.d.ts +1 -1
  224. package/libs/array/find/find.d.ts +1 -1
  225. package/libs/array/find/index.d.ts +1 -1
  226. package/libs/array/inArray/inArray.d.ts +1 -1
  227. package/libs/array/inArray/index.d.ts +1 -1
  228. package/libs/array/index/index.d.ts +1 -1
  229. package/libs/array/index.d.ts +13 -13
  230. package/libs/array/indexOf/index.d.ts +1 -1
  231. package/libs/array/indexOf/indexOf.d.ts +1 -1
  232. package/libs/array/keyExists/index.d.ts +1 -1
  233. package/libs/array/keyExists/keyExists.d.ts +1 -1
  234. package/libs/array/ksort/index.d.ts +1 -1
  235. package/libs/array/ksort/ksort.d.ts +1 -1
  236. package/libs/array/list/index.d.ts +1 -1
  237. package/libs/array/list/list.d.ts +1 -1
  238. package/libs/array/nameValue/index.d.ts +1 -1
  239. package/libs/array/nameValue/nameValue.d.ts +1 -1
  240. package/libs/array/remove/index.d.ts +1 -1
  241. package/libs/array/remove/remove.d.ts +1 -1
  242. package/libs/array/rsort/index.d.ts +1 -1
  243. package/libs/array/rsort/rsort.d.ts +1 -1
  244. package/libs/array/sort/index.d.ts +1 -1
  245. package/libs/array/sort/sort.d.ts +1 -1
  246. package/libs/format/acronym/acronym.d.ts +1 -1
  247. package/libs/format/acronym/index.d.ts +1 -1
  248. package/libs/format/bytes/bytes.d.ts +1 -1
  249. package/libs/format/bytes/index.d.ts +1 -1
  250. package/libs/format/currency/currency.d.ts +1 -1
  251. package/libs/format/currency/index.d.ts +1 -1
  252. package/libs/format/index.d.ts +5 -5
  253. package/libs/format/number/index.d.ts +1 -1
  254. package/libs/format/number/number.d.ts +1 -1
  255. package/libs/format/truncate/index.d.ts +1 -1
  256. package/libs/format/truncate/truncate.d.ts +1 -1
  257. package/libs/index.d.ts +5 -5
  258. package/libs/rxjs/delayedRetry.d.ts +2 -2
  259. package/libs/util/boolean/boolean.d.ts +1 -1
  260. package/libs/util/boolean/index.d.ts +1 -1
  261. package/libs/util/debounce/debounce.d.ts +1 -1
  262. package/libs/util/debounce/index.d.ts +1 -1
  263. package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
  264. package/libs/util/get-normalized-path/index.d.ts +1 -1
  265. package/libs/util/guid/guid.d.ts +1 -1
  266. package/libs/util/guid/index.d.ts +1 -1
  267. package/libs/util/index.d.ts +17 -17
  268. package/libs/util/isClass/index.d.ts +1 -1
  269. package/libs/util/isClass/isClass.d.ts +1 -1
  270. package/libs/util/isEmpty/index.d.ts +1 -1
  271. package/libs/util/isEmpty/isEmpty.d.ts +1 -1
  272. package/libs/util/isNumeric/index.d.ts +1 -1
  273. package/libs/util/isNumeric/isNumeric.d.ts +1 -1
  274. package/libs/util/keys/index.d.ts +1 -1
  275. package/libs/util/keys/keys.d.ts +37 -37
  276. package/libs/util/length/index.d.ts +1 -1
  277. package/libs/util/length/length.d.ts +1 -1
  278. package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
  279. package/libs/util/queue/index.d.ts +2 -2
  280. package/libs/util/queue/operation.d.ts +7 -7
  281. package/libs/util/queue/queue.d.ts +32 -32
  282. package/libs/util/queue/queue.enum.d.ts +4 -4
  283. package/libs/util/remove-query-params/index.d.ts +1 -1
  284. package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
  285. package/libs/util/resolve/index.d.ts +1 -1
  286. package/libs/util/resolve/resolve.d.ts +1 -1
  287. package/libs/util/stringify/index.d.ts +1 -1
  288. package/libs/util/stringify/stringify.d.ts +1 -1
  289. package/libs/util/throttle/index.d.ts +1 -1
  290. package/libs/util/throttle/throttle.d.ts +1 -1
  291. package/libs/util/uuid/index.d.ts +1 -1
  292. package/libs/util/uuid/uuid.d.ts +1 -1
  293. package/libs/util/value/index.d.ts +1 -1
  294. package/libs/util/value/value.d.ts +1 -1
  295. package/libs/validate/email/email.d.ts +1 -1
  296. package/libs/validate/email/index.d.ts +1 -1
  297. package/libs/validate/index.d.ts +3 -3
  298. package/libs/validate/phone/index.d.ts +1 -1
  299. package/libs/validate/phone/phone.d.ts +1 -1
  300. package/libs/validate/url/index.d.ts +1 -1
  301. package/libs/validate/url/url.d.ts +7 -7
  302. package/package.json +1 -1
  303. package/public_api.d.ts +6 -6
@@ -1,367 +1,367 @@
1
- /**
2
- * @fileoverview added by tsickle
3
- * Generated from: libs/util/queue/queue.ts
4
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5
- */
6
- import { Observable, Subject } from 'rxjs';
7
- import { Operation } from './operation';
8
- import { QueueState } from './queue.enum';
9
- import { delay, takeUntil } from 'rxjs/operators';
10
- var Queue = /** @class */ (function () {
11
- function Queue(_limit) {
12
- if (_limit === void 0) { _limit = Infinity; }
13
- this._limit = _limit;
14
- this._done = new Subject();
15
- this._queue = [];
16
- this._inProgress = [];
17
- this._total = 0;
18
- this._completed = 0;
19
- this._errors = 0;
20
- this._state = QueueState.Idle;
21
- this._destroy$ = new Subject();
22
- }
23
- Object.defineProperty(Queue.prototype, "total", {
24
- get: /**
25
- * @return {?}
26
- */
27
- function () {
28
- return this._total;
29
- },
30
- enumerable: true,
31
- configurable: true
32
- });
33
- Object.defineProperty(Queue.prototype, "completed", {
34
- get: /**
35
- * @return {?}
36
- */
37
- function () {
38
- return this._completed;
39
- },
40
- enumerable: true,
41
- configurable: true
42
- });
43
- Object.defineProperty(Queue.prototype, "pending", {
44
- get: /**
45
- * @return {?}
46
- */
47
- function () {
48
- return this._queue.length;
49
- },
50
- enumerable: true,
51
- configurable: true
52
- });
53
- Object.defineProperty(Queue.prototype, "inProgress", {
54
- get: /**
55
- * @return {?}
56
- */
57
- function () {
58
- return this._inProgress.length;
59
- },
60
- enumerable: true,
61
- configurable: true
62
- });
63
- Object.defineProperty(Queue.prototype, "errors", {
64
- get: /**
65
- * @return {?}
66
- */
67
- function () {
68
- return this._errors;
69
- },
70
- enumerable: true,
71
- configurable: true
72
- });
73
- Object.defineProperty(Queue.prototype, "state", {
74
- get: /**
75
- * @return {?}
76
- */
77
- function () {
78
- return this._state;
79
- },
80
- enumerable: true,
81
- configurable: true
82
- });
83
- Object.defineProperty(Queue.prototype, "empty", {
84
- get: /**
85
- * @return {?}
86
- */
87
- function () {
88
- return !this._queue.length && !this._inProgress.length;
89
- },
90
- enumerable: true,
91
- configurable: true
92
- });
93
- Object.defineProperty(Queue.prototype, "pendingOperations", {
94
- get: /**
95
- * @return {?}
96
- */
97
- function () {
98
- return this._queue
99
- .map((/**
100
- * @param {?} operation
101
- * @return {?}
102
- */
103
- function (operation) { return operation.name; }));
104
- },
105
- enumerable: true,
106
- configurable: true
107
- });
108
- Object.defineProperty(Queue.prototype, "inProgressOperations", {
109
- get: /**
110
- * @return {?}
111
- */
112
- function () {
113
- return this._inProgress
114
- .map((/**
115
- * @param {?} operation
116
- * @return {?}
117
- */
118
- function (operation) { return operation.name; }));
119
- },
120
- enumerable: true,
121
- configurable: true
122
- });
123
- /**
124
- * @return {?}
125
- */
126
- Queue.prototype.isProcessing = /**
127
- * @return {?}
128
- */
129
- function () {
130
- return this._state === QueueState.Processing;
131
- };
132
- /**
133
- * @return {?}
134
- */
135
- Queue.prototype.isIdle = /**
136
- * @return {?}
137
- */
138
- function () {
139
- return this._state === QueueState.Idle;
140
- };
141
- /**
142
- * @param {?} value
143
- * @return {?}
144
- */
145
- Queue.prototype.setLimit = /**
146
- * @param {?} value
147
- * @return {?}
148
- */
149
- function (value) {
150
- this._limit = value;
151
- };
152
- /**
153
- * @param {?} fun
154
- * @param {?=} err
155
- * @param {?=} complete
156
- * @return {?}
157
- */
158
- Queue.prototype.subscribe = /**
159
- * @param {?} fun
160
- * @param {?=} err
161
- * @param {?=} complete
162
- * @return {?}
163
- */
164
- function (fun, err, complete) {
165
- this._done
166
- .pipe(takeUntil(this._destroy$))
167
- .subscribe(fun, err, complete);
168
- };
169
- /**
170
- * @param {?} fun
171
- * @param {?=} err
172
- * @param {?=} complete
173
- * @return {?}
174
- */
175
- Queue.prototype.complete = /**
176
- * @param {?} fun
177
- * @param {?=} err
178
- * @param {?=} complete
179
- * @return {?}
180
- */
181
- function (fun, err, complete) {
182
- var _this = this;
183
- Observable.create((/**
184
- * @param {?} observer
185
- * @return {?}
186
- */
187
- function (observer) {
188
- if (!_this.isProcessing()) {
189
- observer.next();
190
- observer.complete();
191
- return;
192
- }
193
- _this.subscribe((/**
194
- * @return {?}
195
- */
196
- function () {
197
- observer.next();
198
- observer.complete();
199
- }), (/**
200
- * @param {?} error
201
- * @return {?}
202
- */
203
- function (error) {
204
- observer.error(error);
205
- _this.clear();
206
- }));
207
- })).subscribe(fun, err, complete);
208
- };
209
- /**
210
- * @param {?} target
211
- * @param {?=} name
212
- * @return {?}
213
- */
214
- Queue.prototype.push = /**
215
- * @param {?} target
216
- * @param {?=} name
217
- * @return {?}
218
- */
219
- function (target, name) {
220
- /** @type {?} */
221
- var operation = new Operation(target, name);
222
- this._total++;
223
- this._state = QueueState.Processing;
224
- if (this._inProgress.length < this._limit) {
225
- this._processOperation(operation);
226
- }
227
- else {
228
- this._queue.push(operation);
229
- }
230
- return operation.ready$;
231
- };
232
- /**
233
- * @return {?}
234
- */
235
- Queue.prototype.clear = /**
236
- * @return {?}
237
- */
238
- function () {
239
- this._queue = [];
240
- this._total = 0;
241
- this._errors = 0;
242
- this._completed = 0;
243
- this._state = QueueState.Idle;
244
- this._done = new Subject();
245
- };
246
- /**
247
- * @return {?}
248
- */
249
- Queue.prototype.destroy = /**
250
- * @return {?}
251
- */
252
- function () {
253
- this.clear();
254
- this._done.complete();
255
- };
256
- /**
257
- * @private
258
- * @param {?} operation
259
- * @return {?}
260
- */
261
- Queue.prototype._processOperation = /**
262
- * @private
263
- * @param {?} operation
264
- * @return {?}
265
- */
266
- function (operation) {
267
- var _this = this;
268
- this._inProgress.push(operation);
269
- operation.target
270
- .pipe(delay(200), // Hack to prevent extra quick proccess execution
271
- takeUntil(this._destroy$)).subscribe({
272
- next: (/**
273
- * @param {?} data
274
- * @return {?}
275
- */
276
- function (data) {
277
- operation.ready$.next(data);
278
- }),
279
- error: (/**
280
- * @param {?} error
281
- * @return {?}
282
- */
283
- function (error) {
284
- /** @type {?} */
285
- var opIndex = _this._inProgress.indexOf(operation);
286
- _this._inProgress.splice(opIndex, 1);
287
- _this._errors++;
288
- operation.ready$.error(error);
289
- if (_this.empty) {
290
- _this._state = QueueState.Idle;
291
- _this._done.error(error);
292
- }
293
- }),
294
- complete: (/**
295
- * @return {?}
296
- */
297
- function () {
298
- /** @type {?} */
299
- var opIndex = _this._inProgress.indexOf(operation);
300
- _this._inProgress.splice(opIndex, 1);
301
- _this._completed++;
302
- operation.ready$.complete();
303
- if (_this.empty) {
304
- _this._state = QueueState.Idle;
305
- _this._done.next();
306
- }
307
- else {
308
- if (_this._queue.length) {
309
- /** @type {?} */
310
- var queueItem = _this._queue.shift();
311
- _this._processOperation(queueItem);
312
- }
313
- }
314
- })
315
- });
316
- };
317
- return Queue;
318
- }());
319
- export { Queue };
320
- if (false) {
321
- /**
322
- * @type {?}
323
- * @private
324
- */
325
- Queue.prototype._done;
326
- /**
327
- * @type {?}
328
- * @private
329
- */
330
- Queue.prototype._queue;
331
- /**
332
- * @type {?}
333
- * @private
334
- */
335
- Queue.prototype._inProgress;
336
- /**
337
- * @type {?}
338
- * @private
339
- */
340
- Queue.prototype._total;
341
- /**
342
- * @type {?}
343
- * @private
344
- */
345
- Queue.prototype._completed;
346
- /**
347
- * @type {?}
348
- * @private
349
- */
350
- Queue.prototype._errors;
351
- /**
352
- * @type {?}
353
- * @private
354
- */
355
- Queue.prototype._state;
356
- /**
357
- * @type {?}
358
- * @private
359
- */
360
- Queue.prototype._destroy$;
361
- /**
362
- * @type {?}
363
- * @private
364
- */
365
- Queue.prototype._limit;
366
- }
1
+ /**
2
+ * @fileoverview added by tsickle
3
+ * Generated from: libs/util/queue/queue.ts
4
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5
+ */
6
+ import { Observable, Subject } from 'rxjs';
7
+ import { Operation } from './operation';
8
+ import { QueueState } from './queue.enum';
9
+ import { delay, takeUntil } from 'rxjs/operators';
10
+ var Queue = /** @class */ (function () {
11
+ function Queue(_limit) {
12
+ if (_limit === void 0) { _limit = Infinity; }
13
+ this._limit = _limit;
14
+ this._done = new Subject();
15
+ this._queue = [];
16
+ this._inProgress = [];
17
+ this._total = 0;
18
+ this._completed = 0;
19
+ this._errors = 0;
20
+ this._state = QueueState.Idle;
21
+ this._destroy$ = new Subject();
22
+ }
23
+ Object.defineProperty(Queue.prototype, "total", {
24
+ get: /**
25
+ * @return {?}
26
+ */
27
+ function () {
28
+ return this._total;
29
+ },
30
+ enumerable: true,
31
+ configurable: true
32
+ });
33
+ Object.defineProperty(Queue.prototype, "completed", {
34
+ get: /**
35
+ * @return {?}
36
+ */
37
+ function () {
38
+ return this._completed;
39
+ },
40
+ enumerable: true,
41
+ configurable: true
42
+ });
43
+ Object.defineProperty(Queue.prototype, "pending", {
44
+ get: /**
45
+ * @return {?}
46
+ */
47
+ function () {
48
+ return this._queue.length;
49
+ },
50
+ enumerable: true,
51
+ configurable: true
52
+ });
53
+ Object.defineProperty(Queue.prototype, "inProgress", {
54
+ get: /**
55
+ * @return {?}
56
+ */
57
+ function () {
58
+ return this._inProgress.length;
59
+ },
60
+ enumerable: true,
61
+ configurable: true
62
+ });
63
+ Object.defineProperty(Queue.prototype, "errors", {
64
+ get: /**
65
+ * @return {?}
66
+ */
67
+ function () {
68
+ return this._errors;
69
+ },
70
+ enumerable: true,
71
+ configurable: true
72
+ });
73
+ Object.defineProperty(Queue.prototype, "state", {
74
+ get: /**
75
+ * @return {?}
76
+ */
77
+ function () {
78
+ return this._state;
79
+ },
80
+ enumerable: true,
81
+ configurable: true
82
+ });
83
+ Object.defineProperty(Queue.prototype, "empty", {
84
+ get: /**
85
+ * @return {?}
86
+ */
87
+ function () {
88
+ return !this._queue.length && !this._inProgress.length;
89
+ },
90
+ enumerable: true,
91
+ configurable: true
92
+ });
93
+ Object.defineProperty(Queue.prototype, "pendingOperations", {
94
+ get: /**
95
+ * @return {?}
96
+ */
97
+ function () {
98
+ return this._queue
99
+ .map((/**
100
+ * @param {?} operation
101
+ * @return {?}
102
+ */
103
+ function (operation) { return operation.name; }));
104
+ },
105
+ enumerable: true,
106
+ configurable: true
107
+ });
108
+ Object.defineProperty(Queue.prototype, "inProgressOperations", {
109
+ get: /**
110
+ * @return {?}
111
+ */
112
+ function () {
113
+ return this._inProgress
114
+ .map((/**
115
+ * @param {?} operation
116
+ * @return {?}
117
+ */
118
+ function (operation) { return operation.name; }));
119
+ },
120
+ enumerable: true,
121
+ configurable: true
122
+ });
123
+ /**
124
+ * @return {?}
125
+ */
126
+ Queue.prototype.isProcessing = /**
127
+ * @return {?}
128
+ */
129
+ function () {
130
+ return this._state === QueueState.Processing;
131
+ };
132
+ /**
133
+ * @return {?}
134
+ */
135
+ Queue.prototype.isIdle = /**
136
+ * @return {?}
137
+ */
138
+ function () {
139
+ return this._state === QueueState.Idle;
140
+ };
141
+ /**
142
+ * @param {?} value
143
+ * @return {?}
144
+ */
145
+ Queue.prototype.setLimit = /**
146
+ * @param {?} value
147
+ * @return {?}
148
+ */
149
+ function (value) {
150
+ this._limit = value;
151
+ };
152
+ /**
153
+ * @param {?} fun
154
+ * @param {?=} err
155
+ * @param {?=} complete
156
+ * @return {?}
157
+ */
158
+ Queue.prototype.subscribe = /**
159
+ * @param {?} fun
160
+ * @param {?=} err
161
+ * @param {?=} complete
162
+ * @return {?}
163
+ */
164
+ function (fun, err, complete) {
165
+ this._done
166
+ .pipe(takeUntil(this._destroy$))
167
+ .subscribe(fun, err, complete);
168
+ };
169
+ /**
170
+ * @param {?} fun
171
+ * @param {?=} err
172
+ * @param {?=} complete
173
+ * @return {?}
174
+ */
175
+ Queue.prototype.complete = /**
176
+ * @param {?} fun
177
+ * @param {?=} err
178
+ * @param {?=} complete
179
+ * @return {?}
180
+ */
181
+ function (fun, err, complete) {
182
+ var _this = this;
183
+ Observable.create((/**
184
+ * @param {?} observer
185
+ * @return {?}
186
+ */
187
+ function (observer) {
188
+ if (!_this.isProcessing()) {
189
+ observer.next();
190
+ observer.complete();
191
+ return;
192
+ }
193
+ _this.subscribe((/**
194
+ * @return {?}
195
+ */
196
+ function () {
197
+ observer.next();
198
+ observer.complete();
199
+ }), (/**
200
+ * @param {?} error
201
+ * @return {?}
202
+ */
203
+ function (error) {
204
+ observer.error(error);
205
+ _this.clear();
206
+ }));
207
+ })).subscribe(fun, err, complete);
208
+ };
209
+ /**
210
+ * @param {?} target
211
+ * @param {?=} name
212
+ * @return {?}
213
+ */
214
+ Queue.prototype.push = /**
215
+ * @param {?} target
216
+ * @param {?=} name
217
+ * @return {?}
218
+ */
219
+ function (target, name) {
220
+ /** @type {?} */
221
+ var operation = new Operation(target, name);
222
+ this._total++;
223
+ this._state = QueueState.Processing;
224
+ if (this._inProgress.length < this._limit) {
225
+ this._processOperation(operation);
226
+ }
227
+ else {
228
+ this._queue.push(operation);
229
+ }
230
+ return operation.ready$;
231
+ };
232
+ /**
233
+ * @return {?}
234
+ */
235
+ Queue.prototype.clear = /**
236
+ * @return {?}
237
+ */
238
+ function () {
239
+ this._queue = [];
240
+ this._total = 0;
241
+ this._errors = 0;
242
+ this._completed = 0;
243
+ this._state = QueueState.Idle;
244
+ this._done = new Subject();
245
+ };
246
+ /**
247
+ * @return {?}
248
+ */
249
+ Queue.prototype.destroy = /**
250
+ * @return {?}
251
+ */
252
+ function () {
253
+ this.clear();
254
+ this._done.complete();
255
+ };
256
+ /**
257
+ * @private
258
+ * @param {?} operation
259
+ * @return {?}
260
+ */
261
+ Queue.prototype._processOperation = /**
262
+ * @private
263
+ * @param {?} operation
264
+ * @return {?}
265
+ */
266
+ function (operation) {
267
+ var _this = this;
268
+ this._inProgress.push(operation);
269
+ operation.target
270
+ .pipe(delay(200), // Hack to prevent extra quick proccess execution
271
+ takeUntil(this._destroy$)).subscribe({
272
+ next: (/**
273
+ * @param {?} data
274
+ * @return {?}
275
+ */
276
+ function (data) {
277
+ operation.ready$.next(data);
278
+ }),
279
+ error: (/**
280
+ * @param {?} error
281
+ * @return {?}
282
+ */
283
+ function (error) {
284
+ /** @type {?} */
285
+ var opIndex = _this._inProgress.indexOf(operation);
286
+ _this._inProgress.splice(opIndex, 1);
287
+ _this._errors++;
288
+ operation.ready$.error(error);
289
+ if (_this.empty) {
290
+ _this._state = QueueState.Idle;
291
+ _this._done.error(error);
292
+ }
293
+ }),
294
+ complete: (/**
295
+ * @return {?}
296
+ */
297
+ function () {
298
+ /** @type {?} */
299
+ var opIndex = _this._inProgress.indexOf(operation);
300
+ _this._inProgress.splice(opIndex, 1);
301
+ _this._completed++;
302
+ operation.ready$.complete();
303
+ if (_this.empty) {
304
+ _this._state = QueueState.Idle;
305
+ _this._done.next();
306
+ }
307
+ else {
308
+ if (_this._queue.length) {
309
+ /** @type {?} */
310
+ var queueItem = _this._queue.shift();
311
+ _this._processOperation(queueItem);
312
+ }
313
+ }
314
+ })
315
+ });
316
+ };
317
+ return Queue;
318
+ }());
319
+ export { Queue };
320
+ if (false) {
321
+ /**
322
+ * @type {?}
323
+ * @private
324
+ */
325
+ Queue.prototype._done;
326
+ /**
327
+ * @type {?}
328
+ * @private
329
+ */
330
+ Queue.prototype._queue;
331
+ /**
332
+ * @type {?}
333
+ * @private
334
+ */
335
+ Queue.prototype._inProgress;
336
+ /**
337
+ * @type {?}
338
+ * @private
339
+ */
340
+ Queue.prototype._total;
341
+ /**
342
+ * @type {?}
343
+ * @private
344
+ */
345
+ Queue.prototype._completed;
346
+ /**
347
+ * @type {?}
348
+ * @private
349
+ */
350
+ Queue.prototype._errors;
351
+ /**
352
+ * @type {?}
353
+ * @private
354
+ */
355
+ Queue.prototype._state;
356
+ /**
357
+ * @type {?}
358
+ * @private
359
+ */
360
+ Queue.prototype._destroy$;
361
+ /**
362
+ * @type {?}
363
+ * @private
364
+ */
365
+ Queue.prototype._limit;
366
+ }
367
367
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVldWUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AZmlyZXN0aXRjaC9jb21tb24vIiwic291cmNlcyI6WyJsaWJzL3V0aWwvcXVldWUvcXVldWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUMzQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDMUMsT0FBTyxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUVsRDtJQWVFLGVBQW9CLE1BQWlCO1FBQWpCLHVCQUFBLEVBQUEsaUJBQWlCO1FBQWpCLFdBQU0sR0FBTixNQUFNLENBQVc7UUFiN0IsVUFBSyxHQUFHLElBQUksT0FBTyxFQUFFLENBQUM7UUFFdEIsV0FBTSxHQUFnQixFQUFFLENBQUM7UUFDekIsZ0JBQVcsR0FBZ0IsRUFBRSxDQUFDO1FBRTlCLFdBQU0sR0FBRyxDQUFDLENBQUM7UUFDWCxlQUFVLEdBQUcsQ0FBQyxDQUFDO1FBQ2YsWUFBTyxHQUFHLENBQUMsQ0FBQztRQUVaLFdBQU0sR0FBZSxVQUFVLENBQUMsSUFBSSxDQUFDO1FBRXJDLGNBQVMsR0FBRyxJQUFJLE9BQU8sRUFBUSxDQUFDO0lBRUEsQ0FBQztJQUV6QyxzQkFBSSx3QkFBSzs7OztRQUFUO1lBQ0UsT0FBTyxJQUFJLENBQU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