@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,491 +1,491 @@
1
- /**
2
- * @fileoverview added by tsickle
3
- * Generated from: app/services/array.service.ts
4
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5
- */
6
- import { Injectable } from '@angular/core';
7
- var FsArray = /** @class */ (function () {
8
- function FsArray() {
9
- }
10
- /**
11
- * @deprecated use import { nameValue } from @firestitch/common/array; instead
12
- */
13
- /**
14
- * @deprecated use import { nameValue } from \@firestitch/common/array; instead
15
- * @param {?} array
16
- * @param {?} name
17
- * @param {?} value
18
- * @return {?}
19
- */
20
- FsArray.prototype.nameValue = /**
21
- * @deprecated use import { nameValue } from \@firestitch/common/array; instead
22
- * @param {?} array
23
- * @param {?} name
24
- * @param {?} value
25
- * @return {?}
26
- */
27
- function (array, name, value) {
28
- console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
29
- /** @type {?} */
30
- var list = [];
31
- if (name || value) {
32
- /** @type {?} */
33
- var nameFn_1 = typeof name === 'function' ? name : (/**
34
- * @param {?} item
35
- * @return {?}
36
- */
37
- function (item) { return item[name]; });
38
- /** @type {?} */
39
- var valueFn_1 = typeof value === 'function' ? value : (/**
40
- * @param {?} item
41
- * @return {?}
42
- */
43
- function (item) { return item[value]; });
44
- array.forEach((/**
45
- * @param {?} item
46
- * @return {?}
47
- */
48
- function (item) {
49
- list.push({ name: nameFn_1(item), value: valueFn_1(item) });
50
- }));
51
- }
52
- else {
53
- array.forEach((/**
54
- * @param {?} name
55
- * @param {?} value
56
- * @return {?}
57
- */
58
- function (name, value) {
59
- list.push({ name: name, value: value });
60
- }));
61
- }
62
- return list;
63
- };
64
- /**
65
- * @deprecated use import { remove } from @firestitch/common/array; instead
66
- */
67
- /**
68
- * @deprecated use import { remove } from \@firestitch/common/array; instead
69
- * @param {?} array
70
- * @param {?} query
71
- * @return {?}
72
- */
73
- FsArray.prototype.remove = /**
74
- * @deprecated use import { remove } from \@firestitch/common/array; instead
75
- * @param {?} array
76
- * @param {?} query
77
- * @return {?}
78
- */
79
- function (array, query) {
80
- console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
81
- /** @type {?} */
82
- var idx = this.indexOf(array, query);
83
- if (idx >= 0) {
84
- return array.splice(idx, 1);
85
- }
86
- return idx;
87
- };
88
- /**
89
- * @deprecated use import { indexOf } from @firestitch/common/array; instead
90
- */
91
- /**
92
- * @deprecated use import { indexOf } from \@firestitch/common/array; instead
93
- * @param {?} array
94
- * @param {?} query
95
- * @return {?}
96
- */
97
- FsArray.prototype.indexOf = /**
98
- * @deprecated use import { indexOf } from \@firestitch/common/array; instead
99
- * @param {?} array
100
- * @param {?} query
101
- * @return {?}
102
- */
103
- function (array, query) {
104
- var _this = this;
105
- console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
106
- if (typeof query !== 'function') {
107
- /** @type {?} */
108
- var queryObj_1 = query;
109
- query = (/**
110
- * @param {?} item
111
- * @return {?}
112
- */
113
- function (item) {
114
- return _this.compare(queryObj_1, item);
115
- });
116
- }
117
- for (var i = 0, len = array.length; i < len; i++) {
118
- if (query(array[i])) {
119
- return i;
120
- }
121
- }
122
- return -1;
123
- };
124
- /**
125
- * @deprecated use import { compare } from @firestitch/common/array; instead
126
- */
127
- /**
128
- * @deprecated use import { compare } from \@firestitch/common/array; instead
129
- * @param {?} query
130
- * @param {?} item
131
- * @return {?}
132
- */
133
- FsArray.prototype.compare = /**
134
- * @deprecated use import { compare } from \@firestitch/common/array; instead
135
- * @param {?} query
136
- * @param {?} item
137
- * @return {?}
138
- */
139
- function (query, item) {
140
- console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
141
- /** @type {?} */
142
- var value = true;
143
- for (var key in query) {
144
- value = value && item[key] == query[key];
145
- }
146
- return value;
147
- };
148
- /**
149
- * @deprecated use import { filter } from @firestitch/common/array; instead
150
- */
151
- /**
152
- * @deprecated use import { filter } from \@firestitch/common/array; instead
153
- * @param {?} array
154
- * @param {?} query
155
- * @return {?}
156
- */
157
- FsArray.prototype.filter = /**
158
- * @deprecated use import { filter } from \@firestitch/common/array; instead
159
- * @param {?} array
160
- * @param {?} query
161
- * @return {?}
162
- */
163
- function (array, query) {
164
- var _this = this;
165
- console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
166
- if (typeof query !== 'function') {
167
- /** @type {?} */
168
- var queryObj_2 = query;
169
- query = (/**
170
- * @param {?} item
171
- * @return {?}
172
- */
173
- function (item) {
174
- return _this.compare(queryObj_2, item);
175
- });
176
- }
177
- /** @type {?} */
178
- var isarray = Array.isArray(array);
179
- /** @type {?} */
180
- var list = isarray ? [] : {};
181
- if (isarray)
182
- array.forEach((/**
183
- * @param {?} item
184
- * @param {?} idx
185
- * @return {?}
186
- */
187
- function (item, idx) {
188
- if (query(item)) {
189
- list.push(item);
190
- }
191
- }));
192
- else
193
- Object.keys(array).forEach((/**
194
- * @param {?} key
195
- * @return {?}
196
- */
197
- function (key) {
198
- if (query(array[key])) {
199
- list[key] = array[key];
200
- }
201
- }));
202
- return list;
203
- };
204
- /**
205
- * @deprecated use import { index } from @firestitch/common/array; instead
206
- */
207
- /**
208
- * @deprecated use import { index } from \@firestitch/common/array; instead
209
- * @param {?} array
210
- * @param {?} property
211
- * @return {?}
212
- */
213
- FsArray.prototype.index = /**
214
- * @deprecated use import { index } from \@firestitch/common/array; instead
215
- * @param {?} array
216
- * @param {?} property
217
- * @return {?}
218
- */
219
- function (array, property) {
220
- console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
221
- /** @type {?} */
222
- var list = {};
223
- array.forEach((/**
224
- * @param {?} item
225
- * @param {?} idx
226
- * @return {?}
227
- */
228
- function (item, idx) {
229
- list[item[property]] = item;
230
- }));
231
- return list;
232
- };
233
- /**
234
- * @deprecated use import { sort } from @firestitch/common/array; instead
235
- */
236
- /**
237
- * @deprecated use import { sort } from \@firestitch/common/array; instead
238
- * @param {?} array
239
- * @param {?} query
240
- * @param {?=} reverse
241
- * @return {?}
242
- */
243
- FsArray.prototype.sort = /**
244
- * @deprecated use import { sort } from \@firestitch/common/array; instead
245
- * @param {?} array
246
- * @param {?} query
247
- * @param {?=} reverse
248
- * @return {?}
249
- */
250
- function (array, query, reverse) {
251
- if (reverse === void 0) { reverse = false; }
252
- console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
253
- if (typeof query !== 'function') {
254
- /** @type {?} */
255
- var queryStr_1 = query;
256
- query = (/**
257
- * @param {?} a
258
- * @param {?} b
259
- * @return {?}
260
- */
261
- function (a, b) {
262
- if (reverse) {
263
- if (a[queryStr_1] < b[queryStr_1]) {
264
- return 1;
265
- }
266
- else if (a[queryStr_1] > b[queryStr_1]) {
267
- return -1;
268
- }
269
- }
270
- else {
271
- if (a[queryStr_1] > b[queryStr_1]) {
272
- return 1;
273
- }
274
- else if (a[queryStr_1] < b[queryStr_1]) {
275
- return -1;
276
- }
277
- }
278
- return 0;
279
- });
280
- }
281
- array.sort(query);
282
- return array;
283
- };
284
- /**
285
- * @deprecated use import { rsort } from @firestitch/common/array; instead
286
- */
287
- /**
288
- * @deprecated use import { rsort } from \@firestitch/common/array; instead
289
- * @param {?} array
290
- * @param {?} query
291
- * @return {?}
292
- */
293
- FsArray.prototype.rsort = /**
294
- * @deprecated use import { rsort } from \@firestitch/common/array; instead
295
- * @param {?} array
296
- * @param {?} query
297
- * @return {?}
298
- */
299
- function (array, query) {
300
- console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
301
- return this.sort(array, query, true);
302
- };
303
- /**
304
- * @deprecated use import { list } from @firestitch/common/array; instead
305
- */
306
- /**
307
- * @deprecated use import { list } from \@firestitch/common/array; instead
308
- * @param {?} array
309
- * @param {?} property
310
- * @param {?=} index
311
- * @return {?}
312
- */
313
- FsArray.prototype.list = /**
314
- * @deprecated use import { list } from \@firestitch/common/array; instead
315
- * @param {?} array
316
- * @param {?} property
317
- * @param {?=} index
318
- * @return {?}
319
- */
320
- function (array, property, index) {
321
- if (index === void 0) { index = null; }
322
- console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
323
- /** @type {?} */
324
- var list = index ? {} : [];
325
- array.forEach((/**
326
- * @param {?} item
327
- * @param {?} idx
328
- * @return {?}
329
- */
330
- function (item, idx) {
331
- if (index) {
332
- list[item[index]] = item[property];
333
- }
334
- else {
335
- list.push(item[property]);
336
- }
337
- }));
338
- return list;
339
- };
340
- /**
341
- * @deprecated use import { applyDepth } from @firestitch/common/array; instead
342
- */
343
- /**
344
- * @deprecated use import { applyDepth } from \@firestitch/common/array; instead
345
- * @param {?} objects
346
- * @param {?} parent_property
347
- * @param {?=} id_property
348
- * @param {?=} depth_property
349
- * @return {?}
350
- */
351
- FsArray.prototype.applyDepth = /**
352
- * @deprecated use import { applyDepth } from \@firestitch/common/array; instead
353
- * @param {?} objects
354
- * @param {?} parent_property
355
- * @param {?=} id_property
356
- * @param {?=} depth_property
357
- * @return {?}
358
- */
359
- function (objects, parent_property, id_property, depth_property) {
360
- if (id_property === void 0) { id_property = 'id'; }
361
- if (depth_property === void 0) { depth_property = 'depth'; }
362
- console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
363
- /** @type {?} */
364
- var keyed = {};
365
- objects.forEach((/**
366
- * @param {?} object
367
- * @return {?}
368
- */
369
- function (object) {
370
- if (!object[parent_property]) {
371
- object[depth_property] = 0;
372
- }
373
- keyed[object[id_property]] = object;
374
- }));
375
- Object.keys(keyed).forEach((/**
376
- * @param {?} key
377
- * @return {?}
378
- */
379
- function (key) {
380
- Object.keys(keyed).forEach((/**
381
- * @param {?} key
382
- * @return {?}
383
- */
384
- function (key) {
385
- /** @type {?} */
386
- var object = keyed[key];
387
- if (!keyed[key][depth_property]) {
388
- if (keyed[key][parent_property]) {
389
- keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
390
- }
391
- }
392
- }));
393
- }));
394
- return keyed;
395
- };
396
- /**
397
- * @deprecated use import { inArray } from @firestitch/common/array; instead
398
- */
399
- /**
400
- * @deprecated use import { inArray } from \@firestitch/common/array; instead
401
- * @param {?} values
402
- * @param {?} array
403
- * @return {?}
404
- */
405
- FsArray.prototype.inArray = /**
406
- * @deprecated use import { inArray } from \@firestitch/common/array; instead
407
- * @param {?} values
408
- * @param {?} array
409
- * @return {?}
410
- */
411
- function (values, array) {
412
- console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
413
- if (!Array.isArray(values)) {
414
- values = [values];
415
- }
416
- for (var i = 0, len = values.length; i < len; i++) {
417
- if (array.indexOf(values[i]) >= 0) {
418
- return true;
419
- }
420
- }
421
- return false;
422
- };
423
- /**
424
- * @deprecated use import { keyExists } from @firestitch/common/array; instead
425
- */
426
- /**
427
- * @deprecated use import { keyExists } from \@firestitch/common/array; instead
428
- * @param {?} array
429
- * @param {?} key
430
- * @return {?}
431
- */
432
- FsArray.prototype.keyExists = /**
433
- * @deprecated use import { keyExists } from \@firestitch/common/array; instead
434
- * @param {?} array
435
- * @param {?} key
436
- * @return {?}
437
- */
438
- function (array, key) {
439
- console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
440
- return array.hasOwnProperty(key);
441
- };
442
- /**
443
- * @deprecated use import { length } from @firestitch/common/array; instead
444
- */
445
- /**
446
- * @deprecated use import { length } from \@firestitch/common/array; instead
447
- * @param {?} array
448
- * @return {?}
449
- */
450
- FsArray.prototype.length = /**
451
- * @deprecated use import { length } from \@firestitch/common/array; instead
452
- * @param {?} array
453
- * @return {?}
454
- */
455
- function (array) {
456
- console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
457
- return array.length;
458
- };
459
- /**
460
- * @deprecated use import { ksort } from @firestitch/common/array; instead
461
- */
462
- /**
463
- * @deprecated use import { ksort } from \@firestitch/common/array; instead
464
- * @param {?} unordered
465
- * @return {?}
466
- */
467
- FsArray.prototype.ksort = /**
468
- * @deprecated use import { ksort } from \@firestitch/common/array; instead
469
- * @param {?} unordered
470
- * @return {?}
471
- */
472
- function (unordered) {
473
- console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
474
- Object.keys(unordered).sort().forEach((/**
475
- * @param {?} key
476
- * @return {?}
477
- */
478
- function (key) {
479
- /** @type {?} */
480
- var value = unordered[key];
481
- delete unordered[key];
482
- unordered[key] = value;
483
- }));
484
- };
485
- FsArray.decorators = [
486
- { type: Injectable }
487
- ];
488
- return FsArray;
489
- }());
490
- export { FsArray };
1
+ /**
2
+ * @fileoverview added by tsickle
3
+ * Generated from: app/services/array.service.ts
4
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5
+ */
6
+ import { Injectable } from '@angular/core';
7
+ var FsArray = /** @class */ (function () {
8
+ function FsArray() {
9
+ }
10
+ /**
11
+ * @deprecated use import { nameValue } from @firestitch/common/array; instead
12
+ */
13
+ /**
14
+ * @deprecated use import { nameValue } from \@firestitch/common/array; instead
15
+ * @param {?} array
16
+ * @param {?} name
17
+ * @param {?} value
18
+ * @return {?}
19
+ */
20
+ FsArray.prototype.nameValue = /**
21
+ * @deprecated use import { nameValue } from \@firestitch/common/array; instead
22
+ * @param {?} array
23
+ * @param {?} name
24
+ * @param {?} value
25
+ * @return {?}
26
+ */
27
+ function (array, name, value) {
28
+ console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
29
+ /** @type {?} */
30
+ var list = [];
31
+ if (name || value) {
32
+ /** @type {?} */
33
+ var nameFn_1 = typeof name === 'function' ? name : (/**
34
+ * @param {?} item
35
+ * @return {?}
36
+ */
37
+ function (item) { return item[name]; });
38
+ /** @type {?} */
39
+ var valueFn_1 = typeof value === 'function' ? value : (/**
40
+ * @param {?} item
41
+ * @return {?}
42
+ */
43
+ function (item) { return item[value]; });
44
+ array.forEach((/**
45
+ * @param {?} item
46
+ * @return {?}
47
+ */
48
+ function (item) {
49
+ list.push({ name: nameFn_1(item), value: valueFn_1(item) });
50
+ }));
51
+ }
52
+ else {
53
+ array.forEach((/**
54
+ * @param {?} name
55
+ * @param {?} value
56
+ * @return {?}
57
+ */
58
+ function (name, value) {
59
+ list.push({ name: name, value: value });
60
+ }));
61
+ }
62
+ return list;
63
+ };
64
+ /**
65
+ * @deprecated use import { remove } from @firestitch/common/array; instead
66
+ */
67
+ /**
68
+ * @deprecated use import { remove } from \@firestitch/common/array; instead
69
+ * @param {?} array
70
+ * @param {?} query
71
+ * @return {?}
72
+ */
73
+ FsArray.prototype.remove = /**
74
+ * @deprecated use import { remove } from \@firestitch/common/array; instead
75
+ * @param {?} array
76
+ * @param {?} query
77
+ * @return {?}
78
+ */
79
+ function (array, query) {
80
+ console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
81
+ /** @type {?} */
82
+ var idx = this.indexOf(array, query);
83
+ if (idx >= 0) {
84
+ return array.splice(idx, 1);
85
+ }
86
+ return idx;
87
+ };
88
+ /**
89
+ * @deprecated use import { indexOf } from @firestitch/common/array; instead
90
+ */
91
+ /**
92
+ * @deprecated use import { indexOf } from \@firestitch/common/array; instead
93
+ * @param {?} array
94
+ * @param {?} query
95
+ * @return {?}
96
+ */
97
+ FsArray.prototype.indexOf = /**
98
+ * @deprecated use import { indexOf } from \@firestitch/common/array; instead
99
+ * @param {?} array
100
+ * @param {?} query
101
+ * @return {?}
102
+ */
103
+ function (array, query) {
104
+ var _this = this;
105
+ console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
106
+ if (typeof query !== 'function') {
107
+ /** @type {?} */
108
+ var queryObj_1 = query;
109
+ query = (/**
110
+ * @param {?} item
111
+ * @return {?}
112
+ */
113
+ function (item) {
114
+ return _this.compare(queryObj_1, item);
115
+ });
116
+ }
117
+ for (var i = 0, len = array.length; i < len; i++) {
118
+ if (query(array[i])) {
119
+ return i;
120
+ }
121
+ }
122
+ return -1;
123
+ };
124
+ /**
125
+ * @deprecated use import { compare } from @firestitch/common/array; instead
126
+ */
127
+ /**
128
+ * @deprecated use import { compare } from \@firestitch/common/array; instead
129
+ * @param {?} query
130
+ * @param {?} item
131
+ * @return {?}
132
+ */
133
+ FsArray.prototype.compare = /**
134
+ * @deprecated use import { compare } from \@firestitch/common/array; instead
135
+ * @param {?} query
136
+ * @param {?} item
137
+ * @return {?}
138
+ */
139
+ function (query, item) {
140
+ console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
141
+ /** @type {?} */
142
+ var value = true;
143
+ for (var key in query) {
144
+ value = value && item[key] == query[key];
145
+ }
146
+ return value;
147
+ };
148
+ /**
149
+ * @deprecated use import { filter } from @firestitch/common/array; instead
150
+ */
151
+ /**
152
+ * @deprecated use import { filter } from \@firestitch/common/array; instead
153
+ * @param {?} array
154
+ * @param {?} query
155
+ * @return {?}
156
+ */
157
+ FsArray.prototype.filter = /**
158
+ * @deprecated use import { filter } from \@firestitch/common/array; instead
159
+ * @param {?} array
160
+ * @param {?} query
161
+ * @return {?}
162
+ */
163
+ function (array, query) {
164
+ var _this = this;
165
+ console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
166
+ if (typeof query !== 'function') {
167
+ /** @type {?} */
168
+ var queryObj_2 = query;
169
+ query = (/**
170
+ * @param {?} item
171
+ * @return {?}
172
+ */
173
+ function (item) {
174
+ return _this.compare(queryObj_2, item);
175
+ });
176
+ }
177
+ /** @type {?} */
178
+ var isarray = Array.isArray(array);
179
+ /** @type {?} */
180
+ var list = isarray ? [] : {};
181
+ if (isarray)
182
+ array.forEach((/**
183
+ * @param {?} item
184
+ * @param {?} idx
185
+ * @return {?}
186
+ */
187
+ function (item, idx) {
188
+ if (query(item)) {
189
+ list.push(item);
190
+ }
191
+ }));
192
+ else
193
+ Object.keys(array).forEach((/**
194
+ * @param {?} key
195
+ * @return {?}
196
+ */
197
+ function (key) {
198
+ if (query(array[key])) {
199
+ list[key] = array[key];
200
+ }
201
+ }));
202
+ return list;
203
+ };
204
+ /**
205
+ * @deprecated use import { index } from @firestitch/common/array; instead
206
+ */
207
+ /**
208
+ * @deprecated use import { index } from \@firestitch/common/array; instead
209
+ * @param {?} array
210
+ * @param {?} property
211
+ * @return {?}
212
+ */
213
+ FsArray.prototype.index = /**
214
+ * @deprecated use import { index } from \@firestitch/common/array; instead
215
+ * @param {?} array
216
+ * @param {?} property
217
+ * @return {?}
218
+ */
219
+ function (array, property) {
220
+ console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
221
+ /** @type {?} */
222
+ var list = {};
223
+ array.forEach((/**
224
+ * @param {?} item
225
+ * @param {?} idx
226
+ * @return {?}
227
+ */
228
+ function (item, idx) {
229
+ list[item[property]] = item;
230
+ }));
231
+ return list;
232
+ };
233
+ /**
234
+ * @deprecated use import { sort } from @firestitch/common/array; instead
235
+ */
236
+ /**
237
+ * @deprecated use import { sort } from \@firestitch/common/array; instead
238
+ * @param {?} array
239
+ * @param {?} query
240
+ * @param {?=} reverse
241
+ * @return {?}
242
+ */
243
+ FsArray.prototype.sort = /**
244
+ * @deprecated use import { sort } from \@firestitch/common/array; instead
245
+ * @param {?} array
246
+ * @param {?} query
247
+ * @param {?=} reverse
248
+ * @return {?}
249
+ */
250
+ function (array, query, reverse) {
251
+ if (reverse === void 0) { reverse = false; }
252
+ console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
253
+ if (typeof query !== 'function') {
254
+ /** @type {?} */
255
+ var queryStr_1 = query;
256
+ query = (/**
257
+ * @param {?} a
258
+ * @param {?} b
259
+ * @return {?}
260
+ */
261
+ function (a, b) {
262
+ if (reverse) {
263
+ if (a[queryStr_1] < b[queryStr_1]) {
264
+ return 1;
265
+ }
266
+ else if (a[queryStr_1] > b[queryStr_1]) {
267
+ return -1;
268
+ }
269
+ }
270
+ else {
271
+ if (a[queryStr_1] > b[queryStr_1]) {
272
+ return 1;
273
+ }
274
+ else if (a[queryStr_1] < b[queryStr_1]) {
275
+ return -1;
276
+ }
277
+ }
278
+ return 0;
279
+ });
280
+ }
281
+ array.sort(query);
282
+ return array;
283
+ };
284
+ /**
285
+ * @deprecated use import { rsort } from @firestitch/common/array; instead
286
+ */
287
+ /**
288
+ * @deprecated use import { rsort } from \@firestitch/common/array; instead
289
+ * @param {?} array
290
+ * @param {?} query
291
+ * @return {?}
292
+ */
293
+ FsArray.prototype.rsort = /**
294
+ * @deprecated use import { rsort } from \@firestitch/common/array; instead
295
+ * @param {?} array
296
+ * @param {?} query
297
+ * @return {?}
298
+ */
299
+ function (array, query) {
300
+ console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
301
+ return this.sort(array, query, true);
302
+ };
303
+ /**
304
+ * @deprecated use import { list } from @firestitch/common/array; instead
305
+ */
306
+ /**
307
+ * @deprecated use import { list } from \@firestitch/common/array; instead
308
+ * @param {?} array
309
+ * @param {?} property
310
+ * @param {?=} index
311
+ * @return {?}
312
+ */
313
+ FsArray.prototype.list = /**
314
+ * @deprecated use import { list } from \@firestitch/common/array; instead
315
+ * @param {?} array
316
+ * @param {?} property
317
+ * @param {?=} index
318
+ * @return {?}
319
+ */
320
+ function (array, property, index) {
321
+ if (index === void 0) { index = null; }
322
+ console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
323
+ /** @type {?} */
324
+ var list = index ? {} : [];
325
+ array.forEach((/**
326
+ * @param {?} item
327
+ * @param {?} idx
328
+ * @return {?}
329
+ */
330
+ function (item, idx) {
331
+ if (index) {
332
+ list[item[index]] = item[property];
333
+ }
334
+ else {
335
+ list.push(item[property]);
336
+ }
337
+ }));
338
+ return list;
339
+ };
340
+ /**
341
+ * @deprecated use import { applyDepth } from @firestitch/common/array; instead
342
+ */
343
+ /**
344
+ * @deprecated use import { applyDepth } from \@firestitch/common/array; instead
345
+ * @param {?} objects
346
+ * @param {?} parent_property
347
+ * @param {?=} id_property
348
+ * @param {?=} depth_property
349
+ * @return {?}
350
+ */
351
+ FsArray.prototype.applyDepth = /**
352
+ * @deprecated use import { applyDepth } from \@firestitch/common/array; instead
353
+ * @param {?} objects
354
+ * @param {?} parent_property
355
+ * @param {?=} id_property
356
+ * @param {?=} depth_property
357
+ * @return {?}
358
+ */
359
+ function (objects, parent_property, id_property, depth_property) {
360
+ if (id_property === void 0) { id_property = 'id'; }
361
+ if (depth_property === void 0) { depth_property = 'depth'; }
362
+ console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
363
+ /** @type {?} */
364
+ var keyed = {};
365
+ objects.forEach((/**
366
+ * @param {?} object
367
+ * @return {?}
368
+ */
369
+ function (object) {
370
+ if (!object[parent_property]) {
371
+ object[depth_property] = 0;
372
+ }
373
+ keyed[object[id_property]] = object;
374
+ }));
375
+ Object.keys(keyed).forEach((/**
376
+ * @param {?} key
377
+ * @return {?}
378
+ */
379
+ function (key) {
380
+ Object.keys(keyed).forEach((/**
381
+ * @param {?} key
382
+ * @return {?}
383
+ */
384
+ function (key) {
385
+ /** @type {?} */
386
+ var object = keyed[key];
387
+ if (!keyed[key][depth_property]) {
388
+ if (keyed[key][parent_property]) {
389
+ keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
390
+ }
391
+ }
392
+ }));
393
+ }));
394
+ return keyed;
395
+ };
396
+ /**
397
+ * @deprecated use import { inArray } from @firestitch/common/array; instead
398
+ */
399
+ /**
400
+ * @deprecated use import { inArray } from \@firestitch/common/array; instead
401
+ * @param {?} values
402
+ * @param {?} array
403
+ * @return {?}
404
+ */
405
+ FsArray.prototype.inArray = /**
406
+ * @deprecated use import { inArray } from \@firestitch/common/array; instead
407
+ * @param {?} values
408
+ * @param {?} array
409
+ * @return {?}
410
+ */
411
+ function (values, array) {
412
+ console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
413
+ if (!Array.isArray(values)) {
414
+ values = [values];
415
+ }
416
+ for (var i = 0, len = values.length; i < len; i++) {
417
+ if (array.indexOf(values[i]) >= 0) {
418
+ return true;
419
+ }
420
+ }
421
+ return false;
422
+ };
423
+ /**
424
+ * @deprecated use import { keyExists } from @firestitch/common/array; instead
425
+ */
426
+ /**
427
+ * @deprecated use import { keyExists } from \@firestitch/common/array; instead
428
+ * @param {?} array
429
+ * @param {?} key
430
+ * @return {?}
431
+ */
432
+ FsArray.prototype.keyExists = /**
433
+ * @deprecated use import { keyExists } from \@firestitch/common/array; instead
434
+ * @param {?} array
435
+ * @param {?} key
436
+ * @return {?}
437
+ */
438
+ function (array, key) {
439
+ console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
440
+ return array.hasOwnProperty(key);
441
+ };
442
+ /**
443
+ * @deprecated use import { length } from @firestitch/common/array; instead
444
+ */
445
+ /**
446
+ * @deprecated use import { length } from \@firestitch/common/array; instead
447
+ * @param {?} array
448
+ * @return {?}
449
+ */
450
+ FsArray.prototype.length = /**
451
+ * @deprecated use import { length } from \@firestitch/common/array; instead
452
+ * @param {?} array
453
+ * @return {?}
454
+ */
455
+ function (array) {
456
+ console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
457
+ return array.length;
458
+ };
459
+ /**
460
+ * @deprecated use import { ksort } from @firestitch/common/array; instead
461
+ */
462
+ /**
463
+ * @deprecated use import { ksort } from \@firestitch/common/array; instead
464
+ * @param {?} unordered
465
+ * @return {?}
466
+ */
467
+ FsArray.prototype.ksort = /**
468
+ * @deprecated use import { ksort } from \@firestitch/common/array; instead
469
+ * @param {?} unordered
470
+ * @return {?}
471
+ */
472
+ function (unordered) {
473
+ console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
474
+ Object.keys(unordered).sort().forEach((/**
475
+ * @param {?} key
476
+ * @return {?}
477
+ */
478
+ function (key) {
479
+ /** @type {?} */
480
+ var value = unordered[key];
481
+ delete unordered[key];
482
+ unordered[key] = value;
483
+ }));
484
+ };
485
+ FsArray.decorators = [
486
+ { type: Injectable }
487
+ ];
488
+ return FsArray;
489
+ }());
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ge1xuICAgICAgICAgICAgICAgICAgICBsaXN0LnB1c2goaXRlbSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIGVsc2UgT2JqZWN0LmtleXMoYXJyYXkpLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICAgIGlmIChxdWVyeShhcnJheVtrZXldKSkge1xuICAgICAgICAgICAgICAgIGxpc3Rba2V5XSA9IGFycmF5W2tleV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICAgIHJldHVybiBsaXN0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEBkZXByZWNhdGVkIHVzZSBpbXBvcnQgeyBpbmRleCB9IGZyb20gQGZpcmVzdGl0Y2gvY29tbW9uL2FycmF5OyBpbnN0ZWFkXG4gICAgKi9cbiAgICBwdWJsaWMgaW5kZXgoYXJyYXksIHByb3BlcnR5KTogT2JqZWN0IHtcbiAgICAgICAgY29uc29sZS53YXJuKCdAZGVwcmVjYXRlZCB1c2UgaW1wb3J0IHsgaW5kZXggfSBmcm9tIEBmaXJlc3RpdGNoL2NvbW1vbi9hcnJheTsgaW5zdGVhZCcpO1xuICAgICAgICBsZXQgbGlzdCA9IHt9O1xuICAgICAgICBhcnJheS5mb3JFYWNoKGZ1bmN0aW9uIChpdGVtLCBpZHgpIHtcbiAgICAgICAgICAgIGxpc3RbaXRlbVtwcm9wZXJ0eV1dID0gaXRlbTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiBsaXN0O1xuICAgIH1cblxuXG4gICAgLyoqXG4gICAgICogQGRlcHJlY2F0ZWQgdXNlIGltcG9ydCB7IHNvcnQgfSBmcm9tIEBmaXJlc3RpdGNoL2NvbW1vbi9hcnJheTsgaW5zdGVhZFxuICAgICovXG4gICAgcHVibGljIHNvcnQoYXJyYXksIHF1ZXJ5LCByZXZlcnNlID0gZmFsc2UpOiBBcnJheTxhbnk+IHtcbiAgICAgICAgY29uc29sZS53YXJuKCdAZGVwcmVjYXRlZCB1c2UgaW1wb3J0IHsgc29ydCB9IGZyb20gQGZpcmVzdGl0Y2gvY29tbW9uL2FycmF5OyBpbnN0ZWFkJyk7XG4gICAgICAgIGlmICh0eXBlb2YgcXVlcnkgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0ciA9IHF1ZXJ5O1xuICAgICAgICAgICAgcXVlcnkgPSBmdW5jdGlvbiAoYSwgYikge1xuICAgICAgICAgICAgICAgIGlmIChyZXZlcnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhW3F1ZXJ5U3RyXSA8IGJbcXVlcnlTdHJdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhW3F1ZXJ5U3RyXSA+IGJbcXVlcnlTdHJdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoYVtxdWVyeVN0cl0gPiBiW3F1ZXJ5U3RyXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYVtxdWVyeVN0cl0gPCBiW3F1ZXJ5U3RyXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGFycmF5LnNvcnQocXVlcnkpO1xuICAgICAgICByZXR1cm4gYXJyYXk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQGRlcHJlY2F0ZWQgdXNlIGltcG9ydCB7IHJzb3J0IH0gZnJvbSBAZmlyZXN0a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