@unicom-cloud/utils 0.1.15 → 0.1.17

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 (90) hide show
  1. package/class-name/index.js +5 -5
  2. package/constant/index.js +24 -2
  3. package/constant/platform.js +13 -12
  4. package/constant.js +24 -2
  5. package/content-disposition/index.js +3 -3
  6. package/date/convertTime.js +4 -4
  7. package/event-emitter/index.js +2 -4
  8. package/filesize/types/constants.d.ts +81 -0
  9. package/filesize/types/filesize.d.ts +97 -0
  10. package/index.js +66 -60
  11. package/js-cookie/index.d.ts +116 -0
  12. package/js-cookie/index.js +4 -0
  13. package/js-cookie/src/api.js +56 -0
  14. package/js-cookie/src/assign.js +11 -0
  15. package/js-cookie/src/converter.js +14 -0
  16. package/jsCookie.js +4 -0
  17. package/lunar/lib/Holiday.js +2 -6
  18. package/lunar/lib/HolidayUtil.js +113 -100
  19. package/lunar/lib/I18n.js +395 -975
  20. package/lunar/lib/JieQi.js +12 -16
  21. package/lunar/lib/Lunar.js +224 -672
  22. package/lunar/lib/LunarMonth.js +35 -98
  23. package/lunar/lib/LunarTime.js +24 -103
  24. package/lunar/lib/LunarUtil.js +426 -1728
  25. package/lunar/lib/LunarYear.js +473 -566
  26. package/lunar/lib/ShouXingUtil.js +6714 -6690
  27. package/lunar/lib/Solar.js +24 -49
  28. package/lunar/lib/SolarHalfYear.js +0 -2
  29. package/lunar/lib/SolarMonth.js +4 -6
  30. package/lunar/lib/SolarSeason.js +0 -2
  31. package/lunar/lib/SolarUtil.js +238 -226
  32. package/lunar/lib/SolarWeek.js +7 -11
  33. package/lunar/lib/SolarYear.js +0 -1
  34. package/nzh/nzh.d.ts +74 -0
  35. package/package.json +1 -1
  36. package/query-string/base.d.ts +717 -0
  37. package/query-string/base.js +268 -0
  38. package/query-string/index.d.ts +16 -0
  39. package/query-string/index.js +4 -0
  40. package/query-string/splitOnFirst.js +14 -0
  41. package/queryString.js +4 -0
  42. package/random/index.js +56 -35
  43. package/snapdom/src/api/preCache.js +51 -28
  44. package/snapdom/src/core/cache.js +1 -4
  45. package/snapdom/src/core/capture.js +45 -44
  46. package/snapdom/src/core/clone.js +82 -66
  47. package/snapdom/src/core/prepare.js +168 -46
  48. package/snapdom/src/modules/background.js +29 -19
  49. package/snapdom/src/modules/fonts.js +146 -91
  50. package/snapdom/src/modules/images.js +14 -9
  51. package/snapdom/src/modules/pseudo.js +55 -58
  52. package/snapdom/src/modules/styles.js +22 -22
  53. package/snapdom/src/modules/svgDefs.js +39 -20
  54. package/snapdom/src/utils/cssTools.js +58 -51
  55. package/snapdom/src/utils/helpers.js +197 -140
  56. package/snapdom/types/snapdom.d.ts +101 -0
  57. package/tinycolor/src/conversion.js +1 -1
  58. package/tinycolor/src/index.js +2 -19
  59. package/turbo-stream/src/encode.js +5 -8
  60. package/turbo-stream/src/shared.js +117 -119
  61. package/types/constant/index.d.ts +11 -0
  62. package/types/constant/platform.d.ts +1 -0
  63. package/types/index.d.ts +3 -0
  64. package/types/js-cookie/index.d.ts +1 -0
  65. package/types/js-cookie/src/api.d.mts +2 -0
  66. package/types/js-cookie/src/assign.d.mts +1 -0
  67. package/types/js-cookie/src/converter.d.mts +5 -0
  68. package/types/lunar/lib/Lunar.d.ts +0 -98
  69. package/types/lunar/lib/LunarMonth.d.ts +0 -12
  70. package/types/lunar/lib/LunarTime.d.ts +0 -22
  71. package/types/lunar/lib/LunarUtil.d.ts +0 -90
  72. package/types/lunar/lib/LunarYear.d.ts +0 -30
  73. package/types/lunar/lib/Solar.d.ts +0 -5
  74. package/types/query-string/base.d.ts +11 -0
  75. package/types/query-string/index.d.ts +2 -0
  76. package/types/query-string/splitOnFirst.d.ts +1 -0
  77. package/types/random/index.d.ts +14 -23
  78. package/types/snapdom/src/api/preCache.d.ts +2 -5
  79. package/types/snapdom/src/core/cache.d.ts +0 -3
  80. package/types/snapdom/src/core/clone.d.ts +1 -1
  81. package/types/snapdom/src/modules/background.d.ts +16 -6
  82. package/types/snapdom/src/modules/fonts.d.ts +5 -1
  83. package/types/snapdom/src/modules/pseudo.d.ts +1 -1
  84. package/types/snapdom/src/modules/styles.d.ts +1 -1
  85. package/types/snapdom/src/modules/svgDefs.d.ts +13 -13
  86. package/types/snapdom/src/utils/cssTools.d.ts +2 -10
  87. package/types/snapdom/src/utils/helpers.d.ts +13 -7
  88. package/types/tinycolor/src/conversion.d.ts +1 -1
  89. package/types/turbo-stream/src/shared.d.ts +3 -3
  90. package/url-toolkit/src/url-toolkit.d.ts +22 -0
package/nzh/nzh.d.ts ADDED
@@ -0,0 +1,74 @@
1
+ interface Options {
2
+ /*
3
+ * 十的口语化开关, 默认值为 false
4
+ * 注:Nzh.cn和Nzh.hk中的encodeS方法默认 true
5
+ * */
6
+ tenMin?: boolean;
7
+ /**
8
+ * "万万"化开关, 默认值为 true
9
+ * */
10
+ ww?: boolean;
11
+ }
12
+ interface ToMoneyOptions extends Options {
13
+ /**
14
+ * 输出完整金额开关, toMoney 函数专用配置, 默认 false
15
+ * */
16
+ complete?: boolean;
17
+ /*
18
+ * 输出金额前缀字符, toMoney 函数专用配置, 默认 true
19
+ * */
20
+ outSymbol?: boolean;
21
+ /*
22
+ * 个位为0时不省略元,toMoney 函数专用配置, 默认 false
23
+ * */
24
+ unOmitYuan?: boolean;
25
+ /**
26
+ * 不以源数据加整,以输出结果加“整”(只要输出的结果没有到分位就加“整”)
27
+ */
28
+ forceZheng?: boolean;
29
+ }
30
+ interface Lang {
31
+ ch: string;
32
+ ch_u: string;
33
+ ch_f: string;
34
+ ch_d: string;
35
+ m_t: string;
36
+ m_z: string;
37
+ m_u: string;
38
+ }
39
+ interface Langs {
40
+ s: Lang;
41
+ b: Lang;
42
+ hk_s: Lang;
43
+ hk_b: Lang;
44
+ }
45
+ interface BuiltIn {
46
+ encodeS(num: number | string, options?: Options): string;
47
+ encodeB(num: number | string, options?: Options): string;
48
+ decodeS(zhnum: string, options?: Options): string;
49
+ decodeB(zhnum: string, options?: Options): string;
50
+ toMoney(num: number | string, options?: ToMoneyOptions): string;
51
+ }
52
+
53
+ declare module 'nzh' {
54
+ export default class Nzh {
55
+ constructor(lang: Lang);
56
+ public encode(num: number | string, options?: Options): string;
57
+ public decode(zhnum: string, options?: Options): string;
58
+ public toMoney(num: number | string, options?: ToMoneyOptions): string;
59
+
60
+ static cn: BuiltIn;
61
+ static hk: BuiltIn;
62
+ static langs: Langs;
63
+ }
64
+ }
65
+
66
+ declare module 'nzh/cn' {
67
+ const nzhcn: BuiltIn;
68
+ export default nzhcn;
69
+ }
70
+
71
+ declare module 'nzh/hk' {
72
+ const nzhhk: BuiltIn;
73
+ export default nzhhk;
74
+ }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/utils","version":"0.1.15","dependencies":{},"peerDependencies":{"lodash":"^4.17.21"},"main":"./index.js","type":"module","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/utils","version":"0.1.17","dependencies":{},"peerDependencies":{"lodash":"^4.17.21"},"main":"./index.js","type":"module","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}