@yelon/util 12.0.17 → 12.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. package/LICENSE +21 -21
  2. package/array/array-type.service.d.ts +68 -68
  3. package/array/array.service.d.ts +75 -75
  4. package/array/index.d.ts +2 -2
  5. package/array/yelon-util-array.d.ts +4 -4
  6. package/browser/browser.d.ts +4 -4
  7. package/browser/cookie.service.d.ts +64 -64
  8. package/browser/copy.d.ts +6 -6
  9. package/browser/index.d.ts +5 -5
  10. package/browser/is-empty.d.ts +6 -6
  11. package/browser/scroll.service.d.ts +34 -34
  12. package/browser/style.d.ts +21 -21
  13. package/bundles/browser.umd.js +275 -275
  14. package/bundles/yelon-util-array.umd.js +602 -602
  15. package/bundles/yelon-util-config.umd.js +366 -366
  16. package/bundles/yelon-util-date-time.umd.js +216 -216
  17. package/bundles/yelon-util-decorator.umd.js +437 -437
  18. package/bundles/yelon-util-form.umd.js +116 -116
  19. package/bundles/yelon-util-format.umd.js +726 -726
  20. package/bundles/yelon-util-math.umd.js +83 -83
  21. package/bundles/yelon-util-other.umd.js +652 -652
  22. package/bundles/yelon-util-pipes-currency.umd.js +83 -83
  23. package/bundles/yelon-util-pipes-filter.umd.js +353 -353
  24. package/bundles/yelon-util-pipes-format.umd.js +47 -47
  25. package/bundles/yelon-util-pipes.umd.js +7 -7
  26. package/bundles/yelon-util-token.umd.js +30 -30
  27. package/bundles/yelon-util.umd.js +7 -7
  28. package/config/abc/date-picker.type.d.ts +52 -52
  29. package/config/abc/error-collect.type.d.ts +10 -10
  30. package/config/abc/image.type.d.ts +15 -15
  31. package/config/abc/index.d.ts +16 -16
  32. package/config/abc/loading.type.d.ts +31 -31
  33. package/config/abc/lodop.type.d.ts +33 -33
  34. package/config/abc/media.type.d.ts +11 -11
  35. package/config/abc/onboarding.type.d.ts +4 -4
  36. package/config/abc/page-header.type.d.ts +39 -39
  37. package/config/abc/pdf.type.d.ts +35 -35
  38. package/config/abc/qr.type.d.ts +25 -25
  39. package/config/abc/se.type.d.ts +32 -32
  40. package/config/abc/sg.type.d.ts +10 -10
  41. package/config/abc/st.type.d.ts +427 -427
  42. package/config/abc/sv.type.d.ts +14 -14
  43. package/config/abc/xlsx.type.d.ts +12 -12
  44. package/config/abc/zip.type.d.ts +10 -10
  45. package/config/acl/acl.type.d.ts +32 -32
  46. package/config/auth/auth.type.d.ts +55 -55
  47. package/config/bis/bis.type.d.ts +7 -7
  48. package/config/cache/cache.type.d.ts +40 -40
  49. package/config/chart/chart.type.d.ts +33 -33
  50. package/config/config.service.d.ts +10 -10
  51. package/config/config.types.d.ts +49 -49
  52. package/config/index.d.ts +14 -14
  53. package/config/mock/mock.type.d.ts +18 -18
  54. package/config/sf/sf.type.d.ts +127 -127
  55. package/config/stomp/stomp.type.d.ts +2 -2
  56. package/config/theme/http.type.d.ts +14 -14
  57. package/config/theme/i18n.type.d.ts +8 -8
  58. package/config/theme/index.d.ts +3 -3
  59. package/config/theme/responsive.type.d.ts +12 -12
  60. package/config/util/array.type.d.ts +22 -22
  61. package/config/util/currency.type.d.ts +39 -39
  62. package/config/yelon-util-config.d.ts +4 -4
  63. package/date-time/index.d.ts +2 -2
  64. package/date-time/picker.d.ts +68 -68
  65. package/date-time/time.d.ts +26 -26
  66. package/date-time/yelon-util-date-time.d.ts +4 -4
  67. package/decorator/convert.d.ts +24 -24
  68. package/decorator/index.d.ts +2 -2
  69. package/decorator/yelon-util-decorator.d.ts +4 -4
  70. package/decorator/zone-outside.d.ts +35 -35
  71. package/esm2015/array/array-type.service.js +1 -1
  72. package/esm2015/array/array.service.js +249 -249
  73. package/esm2015/array/index.js +2 -2
  74. package/esm2015/array/yelon-util-array.js +4 -4
  75. package/esm2015/browser/browser.js +4 -4
  76. package/esm2015/browser/cookie.service.js +103 -103
  77. package/esm2015/browser/copy.js +26 -26
  78. package/esm2015/browser/index.js +5 -5
  79. package/esm2015/browser/is-empty.js +18 -18
  80. package/esm2015/browser/scroll.service.js +88 -88
  81. package/esm2015/browser/style.js +37 -37
  82. package/esm2015/config/abc/date-picker.type.js +1 -1
  83. package/esm2015/config/abc/error-collect.type.js +1 -1
  84. package/esm2015/config/abc/image.type.js +1 -1
  85. package/esm2015/config/abc/index.js +16 -16
  86. package/esm2015/config/abc/loading.type.js +1 -1
  87. package/esm2015/config/abc/lodop.type.js +1 -1
  88. package/esm2015/config/abc/media.type.js +1 -1
  89. package/esm2015/config/abc/onboarding.type.js +1 -1
  90. package/esm2015/config/abc/page-header.type.js +1 -1
  91. package/esm2015/config/abc/pdf.type.js +1 -1
  92. package/esm2015/config/abc/qr.type.js +1 -1
  93. package/esm2015/config/abc/se.type.js +1 -1
  94. package/esm2015/config/abc/sg.type.js +1 -1
  95. package/esm2015/config/abc/st.type.js +1 -1
  96. package/esm2015/config/abc/sv.type.js +2 -2
  97. package/esm2015/config/abc/xlsx.type.js +1 -1
  98. package/esm2015/config/abc/zip.type.js +1 -1
  99. package/esm2015/config/acl/acl.type.js +1 -1
  100. package/esm2015/config/auth/auth.type.js +1 -1
  101. package/esm2015/config/bis/bis.type.js +1 -1
  102. package/esm2015/config/cache/cache.type.js +1 -1
  103. package/esm2015/config/chart/chart.type.js +1 -1
  104. package/esm2015/config/config.service.js +33 -33
  105. package/esm2015/config/config.types.js +8 -8
  106. package/esm2015/config/index.js +14 -14
  107. package/esm2015/config/mock/mock.type.js +1 -1
  108. package/esm2015/config/sf/sf.type.js +1 -1
  109. package/esm2015/config/stomp/stomp.type.js +1 -1
  110. package/esm2015/config/theme/http.type.js +1 -1
  111. package/esm2015/config/theme/i18n.type.js +1 -1
  112. package/esm2015/config/theme/index.js +3 -3
  113. package/esm2015/config/theme/responsive.type.js +1 -1
  114. package/esm2015/config/util/array.type.js +1 -1
  115. package/esm2015/config/util/currency.type.js +1 -1
  116. package/esm2015/config/yelon-util-config.js +4 -4
  117. package/esm2015/date-time/index.js +2 -2
  118. package/esm2015/date-time/picker.js +115 -115
  119. package/esm2015/date-time/time.js +83 -83
  120. package/esm2015/date-time/yelon-util-date-time.js +4 -4
  121. package/esm2015/decorator/convert.js +55 -55
  122. package/esm2015/decorator/index.js +2 -2
  123. package/esm2015/decorator/yelon-util-decorator.js +4 -4
  124. package/esm2015/decorator/zone-outside.js +54 -54
  125. package/esm2015/form/index.js +2 -2
  126. package/esm2015/form/match-control.js +29 -29
  127. package/esm2015/form/validators.js +80 -80
  128. package/esm2015/form/yelon-util-form.js +4 -4
  129. package/esm2015/format/currency.service.js +224 -224
  130. package/esm2015/format/currency.types.js +7 -7
  131. package/esm2015/format/index.js +4 -4
  132. package/esm2015/format/string.js +75 -75
  133. package/esm2015/format/validate.js +93 -93
  134. package/esm2015/format/yelon-util-format.js +4 -4
  135. package/esm2015/index.js +11 -11
  136. package/esm2015/math/in-range.js +24 -24
  137. package/esm2015/math/index.js +2 -2
  138. package/esm2015/math/round.js +52 -52
  139. package/esm2015/math/yelon-util-math.js +4 -4
  140. package/esm2015/other/assert.js +66 -66
  141. package/esm2015/other/deep.js +75 -75
  142. package/esm2015/other/index.js +4 -4
  143. package/esm2015/other/lazy.service.js +117 -117
  144. package/esm2015/other/logger.js +32 -32
  145. package/esm2015/other/yelon-util-other.js +4 -4
  146. package/esm2015/pipes/currency/cny.pipe.js +21 -21
  147. package/esm2015/pipes/currency/index.js +3 -3
  148. package/esm2015/pipes/currency/mega.pipe.js +25 -25
  149. package/esm2015/pipes/currency/module.js +13 -13
  150. package/esm2015/pipes/currency/price.pipe.js +25 -25
  151. package/esm2015/pipes/currency/yelon-util-pipes-currency.js +5 -5
  152. package/esm2015/pipes/filter/filter.pipe.js +14 -14
  153. package/esm2015/pipes/filter/index.js +2 -2
  154. package/esm2015/pipes/filter/module.js +11 -11
  155. package/esm2015/pipes/filter/yelon-util-pipes-filter.js +4 -4
  156. package/esm2015/pipes/format/index.js +2 -2
  157. package/esm2015/pipes/format/mask.pipe.js +29 -29
  158. package/esm2015/pipes/format/module.js +11 -11
  159. package/esm2015/pipes/format/yelon-util-pipes-format.js +4 -4
  160. package/esm2015/pipes/index.js +3 -3
  161. package/esm2015/pipes/yelon-util-pipes.js +4 -4
  162. package/esm2015/token/index.js +2 -2
  163. package/esm2015/token/page-visibility.js +15 -15
  164. package/esm2015/token/window.js +16 -16
  165. package/esm2015/token/yelon-util-token.js +4 -4
  166. package/esm2015/yelon-util.js +4 -4
  167. package/fesm2015/browser.js +257 -257
  168. package/fesm2015/yelon-util-array.js +245 -245
  169. package/fesm2015/yelon-util-config.js +36 -36
  170. package/fesm2015/yelon-util-date-time.js +196 -196
  171. package/fesm2015/yelon-util-decorator.js +107 -107
  172. package/fesm2015/yelon-util-form.js +108 -108
  173. package/fesm2015/yelon-util-format.js +390 -390
  174. package/fesm2015/yelon-util-math.js +75 -75
  175. package/fesm2015/yelon-util-other.js +280 -280
  176. package/fesm2015/yelon-util-pipes-currency.js +72 -72
  177. package/fesm2015/yelon-util-pipes-filter.js +22 -22
  178. package/fesm2015/yelon-util-pipes-format.js +36 -36
  179. package/fesm2015/yelon-util-pipes.js +2 -2
  180. package/fesm2015/yelon-util-token.js +25 -25
  181. package/fesm2015/yelon-util.js +2 -2
  182. package/form/index.d.ts +2 -2
  183. package/form/match-control.d.ts +15 -15
  184. package/form/validators.d.ts +62 -62
  185. package/form/yelon-util-form.d.ts +4 -4
  186. package/format/currency.service.d.ts +34 -34
  187. package/format/currency.types.d.ts +77 -77
  188. package/format/index.d.ts +4 -4
  189. package/format/string.d.ts +44 -44
  190. package/format/validate.d.ts +72 -72
  191. package/format/yelon-util-format.d.ts +4 -4
  192. package/index.d.ts +11 -11
  193. package/math/in-range.d.ts +14 -14
  194. package/math/index.d.ts +2 -2
  195. package/math/round.d.ts +33 -33
  196. package/math/yelon-util-math.d.ts +4 -4
  197. package/other/assert.d.ts +36 -36
  198. package/other/deep.d.ts +33 -33
  199. package/other/index.d.ts +4 -4
  200. package/other/lazy.service.d.ts +22 -22
  201. package/other/logger.d.ts +5 -5
  202. package/other/yelon-util-other.d.ts +4 -4
  203. package/package.json +1 -1
  204. package/pipes/currency/cny.pipe.d.ts +12 -12
  205. package/pipes/currency/index.d.ts +3 -3
  206. package/pipes/currency/mega.pipe.d.ts +13 -13
  207. package/pipes/currency/module.d.ts +2 -2
  208. package/pipes/currency/price.pipe.d.ts +16 -16
  209. package/pipes/currency/yelon-util-pipes-currency.d.ts +5 -5
  210. package/pipes/filter/filter.pipe.d.ts +10 -10
  211. package/pipes/filter/index.d.ts +2 -2
  212. package/pipes/filter/module.d.ts +2 -2
  213. package/pipes/filter/yelon-util-pipes-filter.d.ts +4 -4
  214. package/pipes/format/index.d.ts +2 -2
  215. package/pipes/format/mask.pipe.d.ts +24 -24
  216. package/pipes/format/module.d.ts +2 -2
  217. package/pipes/format/yelon-util-pipes-format.d.ts +4 -4
  218. package/pipes/index.d.ts +3 -3
  219. package/pipes/yelon-util-pipes.d.ts +4 -4
  220. package/token/index.d.ts +2 -2
  221. package/token/page-visibility.d.ts +8 -8
  222. package/token/window.d.ts +7 -7
  223. package/token/yelon-util-token.d.ts +4 -4
  224. package/yelon-util.d.ts +4 -4
@@ -1,67 +1,67 @@
1
- import { isObservable } from 'rxjs';
2
- function throwError(msg, actual, expected, comparison) {
3
- if (ngDevMode) {
4
- throw new Error(`ASSERTION ERROR: ${msg}${comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`}`);
5
- }
6
- }
7
- /**
8
- * Assert whether the expression and throw an error into console in dev mode
9
- *
10
- * 断言表达式是否符合预期,并在开发模式下会在控制台抛出一个错误
11
- */
12
- export function assert(expression, msg) {
13
- if (!expression) {
14
- throwError(msg);
15
- }
16
- }
17
- /**
18
- * Assert whether empty (`null` or `undefined`)
19
- *
20
- * 断言是否空值(`null` 或 `undefined`)
21
- */
22
- export function assertEmpty(actual, msg) {
23
- if (actual == null) {
24
- throwError(msg, typeof actual, 'NULL', '==');
25
- }
26
- }
27
- /**
28
- * Assert whether `number` type
29
- *
30
- * 断言是否 `number` 类型
31
- */
32
- export function assertNumber(actual, msg) {
33
- if (!(typeof actual === 'number')) {
34
- throwError(msg, typeof actual, 'number', '===');
35
- }
36
- }
37
- /**
38
- * Assert whether `string` type
39
- *
40
- * 断言是否 `string` 类型
41
- */
42
- export function assertString(actual, msg) {
43
- if (!(typeof actual === 'string')) {
44
- throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');
45
- }
46
- }
47
- /**
48
- * Assert whether `array` type
49
- *
50
- * 断言是否 `array` 类型
51
- */
52
- export function assertArray(actual, msg) {
53
- if (!Array.isArray(actual)) {
54
- throwError(msg, actual === null ? 'null' : typeof actual, 'array', '===');
55
- }
56
- }
57
- /**
58
- * Assert whether `Observable` type
59
- *
60
- * 断言是否 `Observable` 类型
61
- */
62
- export function assertObservable(obj, msg) {
63
- if (!isObservable(obj)) {
64
- throwError(msg, obj === null ? 'null' : typeof obj, 'Observable', '===');
65
- }
66
- }
1
+ import { isObservable } from 'rxjs';
2
+ function throwError(msg, actual, expected, comparison) {
3
+ if (ngDevMode) {
4
+ throw new Error(`ASSERTION ERROR: ${msg}${comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`}`);
5
+ }
6
+ }
7
+ /**
8
+ * Assert whether the expression and throw an error into console in dev mode
9
+ *
10
+ * 断言表达式是否符合预期,并在开发模式下会在控制台抛出一个错误
11
+ */
12
+ export function assert(expression, msg) {
13
+ if (!expression) {
14
+ throwError(msg);
15
+ }
16
+ }
17
+ /**
18
+ * Assert whether empty (`null` or `undefined`)
19
+ *
20
+ * 断言是否空值(`null` 或 `undefined`)
21
+ */
22
+ export function assertEmpty(actual, msg) {
23
+ if (actual == null) {
24
+ throwError(msg, typeof actual, 'NULL', '==');
25
+ }
26
+ }
27
+ /**
28
+ * Assert whether `number` type
29
+ *
30
+ * 断言是否 `number` 类型
31
+ */
32
+ export function assertNumber(actual, msg) {
33
+ if (!(typeof actual === 'number')) {
34
+ throwError(msg, typeof actual, 'number', '===');
35
+ }
36
+ }
37
+ /**
38
+ * Assert whether `string` type
39
+ *
40
+ * 断言是否 `string` 类型
41
+ */
42
+ export function assertString(actual, msg) {
43
+ if (!(typeof actual === 'string')) {
44
+ throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');
45
+ }
46
+ }
47
+ /**
48
+ * Assert whether `array` type
49
+ *
50
+ * 断言是否 `array` 类型
51
+ */
52
+ export function assertArray(actual, msg) {
53
+ if (!Array.isArray(actual)) {
54
+ throwError(msg, actual === null ? 'null' : typeof actual, 'array', '===');
55
+ }
56
+ }
57
+ /**
58
+ * Assert whether `Observable` type
59
+ *
60
+ * 断言是否 `Observable` 类型
61
+ */
62
+ export function assertObservable(obj, msg) {
63
+ if (!isObservable(obj)) {
64
+ throwError(msg, obj === null ? 'null' : typeof obj, 'Observable', '===');
65
+ }
66
+ }
67
67
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdXRpbC9vdGhlci9hc3NlcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLE1BQU0sQ0FBQztBQU1wQyxTQUFTLFVBQVUsQ0FBQyxHQUE4QixFQUFFLE1BQWdCLEVBQUUsUUFBa0IsRUFBRSxVQUFtQjtJQUMzRyxJQUFJLFNBQVMsRUFBRTtRQUNiLE1BQU0sSUFBSSxLQUFLLENBQ2Isb0JBQW9CLEdBQUcsR0FBRyxVQUFVLElBQUksSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLGdCQUFnQixRQUFRLElBQUksVUFBVSxJQUFJLE1BQU0sWUFBWSxFQUFFLENBQ25ILENBQUM7S0FDSDtBQUNILENBQUM7QUFFRDs7OztHQUlHO0FBQ0gsTUFBTSxVQUFVLE1BQU0sQ0FBQyxVQUFtQixFQUFFLEdBQVk7SUFDdEQsSUFB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mcpOiB2b2lkIHtcbiAgaWYgKCFpc09ic2VydmFibGUob2JqKSkge1xuICAgIHRocm93RXJyb3IobXNnLCBvYmogPT09IG51bGwgPyAnbnVsbCcgOiB0eXBlb2Ygb2JqLCAnT2JzZXJ2YWJsZScsICc9PT0nKTtcbiAgfVxufVxuIl19
@@ -1,76 +1,76 @@
1
- import extend from 'extend';
2
- /**
3
- * Gets the value at `path` of `object`, like `_.get` in lodash.
4
- *
5
- * 类似 `_.get`,根据 `path` 获取安全值
6
- */
7
- export function deepGet(obj, path, defaultValue) {
8
- if (!obj || path == null || path.length === 0)
9
- return defaultValue;
10
- if (!Array.isArray(path)) {
11
- path = ~path.indexOf('.') ? path.split('.') : [path];
12
- }
13
- if (path.length === 1) {
14
- const checkObj = obj[path[0]];
15
- return typeof checkObj === 'undefined' ? defaultValue : checkObj;
16
- }
17
- const res = path.reduce((o, k) => (o || {})[k], obj);
18
- return typeof res === 'undefined' ? defaultValue : res;
19
- }
20
- /**
21
- * Base on [extend](https://github.com/justmoon/node-extend) deep copy.
22
- *
23
- * 基于 [extend](https://github.com/justmoon/node-extend) 的深度拷贝
24
- */
25
- export function deepCopy(obj) {
26
- const result = extend(true, {}, { _: obj });
27
- return result._;
28
- }
29
- /**
30
- * Deep merge object.
31
- *
32
- * 深度合并对象
33
- *
34
- * @param original 原始对象
35
- * @param arrayProcessMethod 数组处理方式
36
- * - `true` 表示替换新值,不管新值为哪种类型
37
- * - `false` 表示会合并整个数组(将旧数据与新数据合并成新数组)
38
- * @param objects 要合并的对象
39
- */
40
- export function deepMergeKey(original, arrayProcessMethod, ...objects) {
41
- if (Array.isArray(original) || typeof original !== 'object')
42
- return original;
43
- const isObject = (v) => typeof v === 'object';
44
- const merge = (target, obj) => {
45
- Object.keys(obj)
46
- .filter(key => key !== '__proto__' && Object.prototype.hasOwnProperty.call(obj, key))
47
- .forEach(key => {
48
- const fromValue = obj[key];
49
- const toValue = target[key];
50
- if (Array.isArray(toValue)) {
51
- target[key] = arrayProcessMethod ? fromValue : [...toValue, ...fromValue];
52
- }
53
- else if (typeof fromValue === 'function') {
54
- target[key] = fromValue;
55
- }
56
- else if (fromValue != null && isObject(fromValue) && toValue != null && isObject(toValue)) {
57
- target[key] = merge(toValue, fromValue);
58
- }
59
- else {
60
- target[key] = deepCopy(fromValue);
61
- }
62
- });
63
- return target;
64
- };
65
- objects.filter(v => v != null && isObject(v)).forEach(v => merge(original, v));
66
- return original;
67
- }
68
- /**
69
- * Deep merge object.
70
- *
71
- * 深度合并对象
72
- */
73
- export function deepMerge(original, ...objects) {
74
- return deepMergeKey(original, false, ...objects);
75
- }
1
+ import extend from 'extend';
2
+ /**
3
+ * Gets the value at `path` of `object`, like `_.get` in lodash.
4
+ *
5
+ * 类似 `_.get`,根据 `path` 获取安全值
6
+ */
7
+ export function deepGet(obj, path, defaultValue) {
8
+ if (!obj || path == null || path.length === 0)
9
+ return defaultValue;
10
+ if (!Array.isArray(path)) {
11
+ path = ~path.indexOf('.') ? path.split('.') : [path];
12
+ }
13
+ if (path.length === 1) {
14
+ const checkObj = obj[path[0]];
15
+ return typeof checkObj === 'undefined' ? defaultValue : checkObj;
16
+ }
17
+ const res = path.reduce((o, k) => (o || {})[k], obj);
18
+ return typeof res === 'undefined' ? defaultValue : res;
19
+ }
20
+ /**
21
+ * Base on [extend](https://github.com/justmoon/node-extend) deep copy.
22
+ *
23
+ * 基于 [extend](https://github.com/justmoon/node-extend) 的深度拷贝
24
+ */
25
+ export function deepCopy(obj) {
26
+ const result = extend(true, {}, { _: obj });
27
+ return result._;
28
+ }
29
+ /**
30
+ * Deep merge object.
31
+ *
32
+ * 深度合并对象
33
+ *
34
+ * @param original 原始对象
35
+ * @param arrayProcessMethod 数组处理方式
36
+ * - `true` 表示替换新值,不管新值为哪种类型
37
+ * - `false` 表示会合并整个数组(将旧数据与新数据合并成新数组)
38
+ * @param objects 要合并的对象
39
+ */
40
+ export function deepMergeKey(original, arrayProcessMethod, ...objects) {
41
+ if (Array.isArray(original) || typeof original !== 'object')
42
+ return original;
43
+ const isObject = (v) => typeof v === 'object';
44
+ const merge = (target, obj) => {
45
+ Object.keys(obj)
46
+ .filter(key => key !== '__proto__' && Object.prototype.hasOwnProperty.call(obj, key))
47
+ .forEach(key => {
48
+ const fromValue = obj[key];
49
+ const toValue = target[key];
50
+ if (Array.isArray(toValue)) {
51
+ target[key] = arrayProcessMethod ? fromValue : [...toValue, ...fromValue];
52
+ }
53
+ else if (typeof fromValue === 'function') {
54
+ target[key] = fromValue;
55
+ }
56
+ else if (fromValue != null && isObject(fromValue) && toValue != null && isObject(toValue)) {
57
+ target[key] = merge(toValue, fromValue);
58
+ }
59
+ else {
60
+ target[key] = deepCopy(fromValue);
61
+ }
62
+ });
63
+ return target;
64
+ };
65
+ objects.filter(v => v != null && isObject(v)).forEach(v => merge(original, v));
66
+ return original;
67
+ }
68
+ /**
69
+ * Deep merge object.
70
+ *
71
+ * 深度合并对象
72
+ */
73
+ export function deepMerge(original, ...objects) {
74
+ return deepMergeKey(original, false, ...objects);
75
+ }
76
76
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVlcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3V0aWwvb3RoZXIvZGVlcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE1BQU0sTUFBTSxRQUFRLENBQUM7QUFJNUI7Ozs7R0FJRztBQUNILE1BQU0sVUFBVSxPQUFPLENBQUMsR0FBYyxFQUFFLElBQTBDLEVBQUUsWUFBc0I7SUFDeEcsSUFBSSxDQUFDLEdBQUcsSUFBSSxJQUFJLElBQUksSUFBSSxJQUFJLElBQUksQ0FBQyxNQUFNLEtBQUssQ0FBQztRQUFFLE9BQU8sWUFBWSxDQUFDO0lBQ25FLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ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9iamVjdC5cbiAqXG4gKiDmt7HluqblkIjlubblr7nosaFcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGRlZXBNZXJnZShvcmlnaW5hbDogdW5rbm93biwgLi4ub2JqZWN0czogdW5rbm93bltdKTogTnpTYWZlQW55IHtcbiAgcmV0dXJuIGRlZXBNZXJnZUtleShvcmlnaW5hbCwgZmFsc2UsIC4uLm9iamVjdHMpO1xufVxuIl19
@@ -1,5 +1,5 @@
1
- export * from './deep';
2
- export * from './logger';
3
- export * from './lazy.service';
4
- export * from './assert';
1
+ export * from './deep';
2
+ export * from './logger';
3
+ export * from './lazy.service';
4
+ export * from './assert';
5
5
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL290aGVyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsUUFBUSxDQUFDO0FBQ3ZCLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxVQUFVLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2RlZXAnO1xuZXhwb3J0ICogZnJvbSAnLi9sb2dnZXInO1xuZXhwb3J0ICogZnJvbSAnLi9sYXp5LnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9hc3NlcnQnO1xuIl19
@@ -1,118 +1,118 @@
1
- import { DOCUMENT } from '@angular/common';
2
- import { Inject, Injectable } from '@angular/core';
3
- import { BehaviorSubject } from 'rxjs';
4
- import { filter, share } from 'rxjs/operators';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/common";
7
- /**
8
- * 延迟加载资源(js 或 css)服务
9
- */
10
- export class LazyService {
11
- constructor(doc) {
12
- this.doc = doc;
13
- this.list = {};
14
- this.cached = {};
15
- this._notify = new BehaviorSubject([]);
16
- }
17
- get change() {
18
- return this._notify.asObservable().pipe(share(), filter(ls => ls.length !== 0));
19
- }
20
- clear() {
21
- this.list = {};
22
- this.cached = {};
23
- }
24
- load(paths) {
25
- if (!Array.isArray(paths)) {
26
- paths = [paths];
27
- }
28
- const promises = [];
29
- paths.forEach(path => {
30
- if (path.endsWith('.js')) {
31
- promises.push(this.loadScript(path));
32
- }
33
- else {
34
- promises.push(this.loadStyle(path));
35
- }
36
- });
37
- return Promise.all(promises).then(res => {
38
- this._notify.next(res);
39
- return Promise.resolve(res);
40
- });
41
- }
42
- loadScript(path, innerContent) {
43
- return new Promise(resolve => {
44
- if (this.list[path] === true) {
45
- resolve(Object.assign(Object.assign({}, this.cached[path]), { status: 'loading' }));
46
- return;
47
- }
48
- this.list[path] = true;
49
- const onSuccess = (item) => {
50
- this.cached[path] = item;
51
- resolve(item);
52
- this._notify.next([item]);
53
- };
54
- const node = this.doc.createElement('script');
55
- node.type = 'text/javascript';
56
- node.src = path;
57
- node.charset = 'utf-8';
58
- if (innerContent) {
59
- node.innerHTML = innerContent;
60
- }
61
- if (node.readyState) {
62
- // IE
63
- node.onreadystatechange = () => {
64
- if (node.readyState === 'loaded' || node.readyState === 'complete') {
65
- node.onreadystatechange = null;
66
- onSuccess({
67
- path,
68
- status: 'ok'
69
- });
70
- }
71
- };
72
- }
73
- else {
74
- node.onload = () => onSuccess({
75
- path,
76
- status: 'ok'
77
- });
78
- }
79
- node.onerror = (error) => onSuccess({
80
- path,
81
- status: 'error',
82
- error
83
- });
84
- this.doc.getElementsByTagName('head')[0].appendChild(node);
85
- });
86
- }
87
- loadStyle(path, rel = 'stylesheet', innerContent) {
88
- return new Promise(resolve => {
89
- if (this.list[path] === true) {
90
- resolve(this.cached[path]);
91
- return;
92
- }
93
- this.list[path] = true;
94
- const node = this.doc.createElement('link');
95
- node.rel = rel;
96
- node.type = 'text/css';
97
- node.href = path;
98
- if (innerContent) {
99
- node.innerHTML = innerContent;
100
- }
101
- this.doc.getElementsByTagName('head')[0].appendChild(node);
102
- const item = {
103
- path,
104
- status: 'ok'
105
- };
106
- this.cached[path] = item;
107
- resolve(item);
108
- });
109
- }
110
- }
111
- LazyService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LazyService_Factory() { return new LazyService(i0.ɵɵinject(i1.DOCUMENT)); }, token: LazyService, providedIn: "root" });
112
- LazyService.decorators = [
113
- { type: Injectable, args: [{ providedIn: 'root' },] }
114
- ];
115
- LazyService.ctorParameters = () => [
116
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
117
- ];
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { Inject, Injectable } from '@angular/core';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { filter, share } from 'rxjs/operators';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/common";
7
+ /**
8
+ * 延迟加载资源(js 或 css)服务
9
+ */
10
+ export class LazyService {
11
+ constructor(doc) {
12
+ this.doc = doc;
13
+ this.list = {};
14
+ this.cached = {};
15
+ this._notify = new BehaviorSubject([]);
16
+ }
17
+ get change() {
18
+ return this._notify.asObservable().pipe(share(), filter(ls => ls.length !== 0));
19
+ }
20
+ clear() {
21
+ this.list = {};
22
+ this.cached = {};
23
+ }
24
+ load(paths) {
25
+ if (!Array.isArray(paths)) {
26
+ paths = [paths];
27
+ }
28
+ const promises = [];
29
+ paths.forEach(path => {
30
+ if (path.endsWith('.js')) {
31
+ promises.push(this.loadScript(path));
32
+ }
33
+ else {
34
+ promises.push(this.loadStyle(path));
35
+ }
36
+ });
37
+ return Promise.all(promises).then(res => {
38
+ this._notify.next(res);
39
+ return Promise.resolve(res);
40
+ });
41
+ }
42
+ loadScript(path, innerContent) {
43
+ return new Promise(resolve => {
44
+ if (this.list[path] === true) {
45
+ resolve(Object.assign(Object.assign({}, this.cached[path]), { status: 'loading' }));
46
+ return;
47
+ }
48
+ this.list[path] = true;
49
+ const onSuccess = (item) => {
50
+ this.cached[path] = item;
51
+ resolve(item);
52
+ this._notify.next([item]);
53
+ };
54
+ const node = this.doc.createElement('script');
55
+ node.type = 'text/javascript';
56
+ node.src = path;
57
+ node.charset = 'utf-8';
58
+ if (innerContent) {
59
+ node.innerHTML = innerContent;
60
+ }
61
+ if (node.readyState) {
62
+ // IE
63
+ node.onreadystatechange = () => {
64
+ if (node.readyState === 'loaded' || node.readyState === 'complete') {
65
+ node.onreadystatechange = null;
66
+ onSuccess({
67
+ path,
68
+ status: 'ok'
69
+ });
70
+ }
71
+ };
72
+ }
73
+ else {
74
+ node.onload = () => onSuccess({
75
+ path,
76
+ status: 'ok'
77
+ });
78
+ }
79
+ node.onerror = (error) => onSuccess({
80
+ path,
81
+ status: 'error',
82
+ error
83
+ });
84
+ this.doc.getElementsByTagName('head')[0].appendChild(node);
85
+ });
86
+ }
87
+ loadStyle(path, rel = 'stylesheet', innerContent) {
88
+ return new Promise(resolve => {
89
+ if (this.list[path] === true) {
90
+ resolve(this.cached[path]);
91
+ return;
92
+ }
93
+ this.list[path] = true;
94
+ const node = this.doc.createElement('link');
95
+ node.rel = rel;
96
+ node.type = 'text/css';
97
+ node.href = path;
98
+ if (innerContent) {
99
+ node.innerHTML = innerContent;
100
+ }
101
+ this.doc.getElementsByTagName('head')[0].appendChild(node);
102
+ const item = {
103
+ path,
104
+ status: 'ok'
105
+ };
106
+ this.cached[path] = item;
107
+ resolve(item);
108
+ });
109
+ }
110
+ }
111
+ LazyService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LazyService_Factory() { return new LazyService(i0.ɵɵinject(i1.DOCUMENT)); }, token: LazyService, providedIn: "root" });
112
+ LazyService.decorators = [
113
+ { type: Injectable, args: [{ providedIn: 'root' },] }
114
+ ];
115
+ LazyService.ctorParameters = () => [
116
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
117
+ ];
118
118
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaW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ICAgICAgbm9kZS5zcmMgPSBwYXRoO1xuICAgICAgbm9kZS5jaGFyc2V0ID0gJ3V0Zi04JztcbiAgICAgIGlmIChpbm5lckNvbnRlbnQpIHtcbiAgICAgICAgbm9kZS5pbm5lckhUTUwgPSBpbm5lckNvbnRlbnQ7XG4gICAgICB9XG4gICAgICBpZiAobm9kZS5yZWFkeVN0YXRlKSB7XG4gICAgICAgIC8vIElFXG4gICAgICAgIG5vZGUub25yZWFkeXN0YXRlY2hhbmdlID0gKCkgPT4ge1xuICAgICAgICAgIGlmIChub2RlLnJlYWR5U3RhdGUgPT09ICdsb2FkZWQnIHx8IG5vZGUucmVhZHlTdGF0ZSA9PT0gJ2NvbXBsZXRlJykge1xuICAgICAgICAgICAgbm9kZS5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBudWxsO1xuICAgICAgICAgICAgb25TdWNjZXNzKHtcbiAgICAgICAgICAgICAgcGF0aCxcbiAgICAgICAgICAgICAgc3RhdHVzOiAnb2snXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBub2RlLm9ubG9hZCA9ICgpID0+XG4gICAgICAgICAgb25TdWNjZXNzKHtcbiAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICBzdGF0dXM6ICdvaydcbiAgICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIG5vZGUub25lcnJvciA9IChlcnJvcjogTnpTYWZlQW55KSA9PlxuICAgICAgICBvblN1Y2Nlc3Moe1xuICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgc3RhdHVzOiAnZXJyb3InLFxuICAgICAgICAgIGVycm9yXG4gICAgICAgIH0pO1xuICAgICAgdGhpcy5kb2MuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2hlYWQnKVswXS5hcHBlbmRDaGlsZChub2RlKTtcbiAgICB9KTtcbiAgfVxuXG4gIGxvYWRTdHlsZShwYXRoOiBzdHJpbmcsIHJlbDogc3RyaW5nID0gJ3N0eWxlc2hlZXQnLCBpbm5lckNvbnRlbnQ/OiBzdHJpbmcpOiBQcm9taXNlPExhenlSZXN1bHQ+IHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UocmVzb2x2ZSA9PiB7XG4gICAgICBpZiAodGhpcy5saXN0W3BhdGhdID09PSB0cnVlKSB7XG4gICAgICAgIHJlc29sdmUodGhpcy5jYWNoZWRbcGF0aF0pO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIHRoaXMubGlzdFtwYXRoXSA9IHRydWU7XG5cbiAgICAgIGNvbnN0IG5vZGUgPSB0aGlzLmRvYy5jcmVhdGVFbGVtZW50KCdsaW5rJykgYXMgSFRNTExpbmtFbGVtZW50O1xuICAgICAgbm9kZS5yZWwgPSByZWw7XG4gICAgICBub2RlLnR5cGUgPSAndGV4dC9jc3MnO1xuICAgICAgbm9kZS5ocmVmID0gcGF0aDtcbiAgICAgIGlmIChpbm5lckNvbnRlbnQpIHtcbiAgICAgICAgbm9kZS5pbm5lckhUTUwgPSBpbm5lckNvbnRlbnQ7XG4gICAgICB9XG4gICAgICB0aGlzLmRvYy5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaGVhZCcpWzBdLmFwcGVuZENoaWxkKG5vZGUpO1xuICAgICAgY29uc3QgaXRlbTogTGF6eVJlc3VsdCA9IHtcbiAgICAgICAgcGF0aCxcbiAgICAgICAgc3RhdHVzOiAnb2snXG4gICAgICB9O1xuICAgICAgdGhpcy5jYWNoZWRbcGF0aF0gPSBpdGVtO1xuICAgICAgcmVzb2x2ZShpdGVtKTtcbiAgICB9KTtcbiAgfVxufVxuIl19
@@ -1,33 +1,33 @@
1
- const record = {};
2
- export const PREFIX = '[@YELON]:';
3
- function notRecorded(...args) {
4
- const asRecord = args.reduce((acc, c) => acc + c.toString(), '');
5
- if (record[asRecord]) {
6
- return false;
7
- }
8
- else {
9
- record[asRecord] = true;
10
- return true;
11
- }
12
- }
13
- function consoleCommonBehavior(consoleFunc, ...args) {
14
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && notRecorded(...args)) {
15
- consoleFunc(...args);
16
- }
17
- }
18
- // Warning should only be printed in dev mode and only once.
19
- export const warn = (...args) => consoleCommonBehavior((...arg) => console.warn(PREFIX, ...arg), ...args);
20
- export const warnDeprecation = (...args) => {
21
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
22
- return () => { };
23
- }
24
- const stack = new Error().stack;
25
- return consoleCommonBehavior((...arg) => console.warn(PREFIX, 'deprecated:', ...arg, stack), ...args);
26
- };
27
- // Log should only be printed in dev mode.
28
- export const log = (...args) => {
29
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
30
- console.log(PREFIX, ...args);
31
- }
32
- };
1
+ const record = {};
2
+ export const PREFIX = '[@YELON]:';
3
+ function notRecorded(...args) {
4
+ const asRecord = args.reduce((acc, c) => acc + c.toString(), '');
5
+ if (record[asRecord]) {
6
+ return false;
7
+ }
8
+ else {
9
+ record[asRecord] = true;
10
+ return true;
11
+ }
12
+ }
13
+ function consoleCommonBehavior(consoleFunc, ...args) {
14
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && notRecorded(...args)) {
15
+ consoleFunc(...args);
16
+ }
17
+ }
18
+ // Warning should only be printed in dev mode and only once.
19
+ export const warn = (...args) => consoleCommonBehavior((...arg) => console.warn(PREFIX, ...arg), ...args);
20
+ export const warnDeprecation = (...args) => {
21
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
22
+ return () => { };
23
+ }
24
+ const stack = new Error().stack;
25
+ return consoleCommonBehavior((...arg) => console.warn(PREFIX, 'deprecated:', ...arg, stack), ...args);
26
+ };
27
+ // Log should only be printed in dev mode.
28
+ export const log = (...args) => {
29
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
30
+ console.log(PREFIX, ...args);
31
+ }
32
+ };
33
33
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic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