jinbi-utils 1.0.0-beta.1

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 (72) hide show
  1. package/.babelrc +19 -0
  2. package/.cz-config.js +55 -0
  3. package/.dockerignore +3 -0
  4. package/.editorconfig +12 -0
  5. package/.eslintignore +8 -0
  6. package/.eslintrc.js +54 -0
  7. package/Dockerfile +3 -0
  8. package/README.md +160 -0
  9. package/api-extractor.json +15 -0
  10. package/commitlint.config.js +3 -0
  11. package/dist/index.esm.js +1277 -0
  12. package/dist/index.esm.min.js +15 -0
  13. package/dist/index.umd.js +1348 -0
  14. package/dist/index.umd.min.js +16 -0
  15. package/docs/assets/images/icons.png +0 -0
  16. package/docs/assets/images/icons@2x.png +0 -0
  17. package/docs/assets/images/widgets.png +0 -0
  18. package/docs/assets/images/widgets@2x.png +0 -0
  19. package/docs/assets/js/main.js +1 -0
  20. package/docs/assets/js/search.json +1 -0
  21. package/docs/globals.html +144 -0
  22. package/docs/index.html +147 -0
  23. package/docs/interfaces/file.compressimgqualitycallback.html +212 -0
  24. package/docs/interfaces/file.compressimgscalecallback.html +206 -0
  25. package/docs/interfaces/file.exportbyblobparams.html +294 -0
  26. package/docs/interfaces/file.filesizeobject.html +227 -0
  27. package/docs/interfaces/file.genexportbyblobparams.html +237 -0
  28. package/docs/modules/common.html +188 -0
  29. package/docs/modules/date.html +364 -0
  30. package/docs/modules/file.html +452 -0
  31. package/docs/modules/number.html +356 -0
  32. package/docs/modules/object.html +245 -0
  33. package/docs/modules/print.html +183 -0
  34. package/docs/modules/string.html +352 -0
  35. package/docs/modules/validate.html +389 -0
  36. package/jest.config.js +15 -0
  37. package/package.json +76 -0
  38. package/rollup.config.js +65 -0
  39. package/src/common/index.ts +323 -0
  40. package/src/constant/common.constant.ts +13 -0
  41. package/src/date/index.ts +143 -0
  42. package/src/file/index.ts +296 -0
  43. package/src/http/http.ts +79 -0
  44. package/src/http/httpEnums.ts +61 -0
  45. package/src/index.ts +10 -0
  46. package/src/number/index.ts +190 -0
  47. package/src/object/index.ts +54 -0
  48. package/src/print/index.ts +102 -0
  49. package/src/string/index.ts +111 -0
  50. package/src/validate/index.ts +78 -0
  51. package/src/wecom/wecom.ts +75 -0
  52. package/test/common/index.test.ts +19 -0
  53. package/test/date/index.test.ts +107 -0
  54. package/test/file/index.test.ts +104 -0
  55. package/test/number/index.test.ts +108 -0
  56. package/test/object/index.test.ts +20 -0
  57. package/test/string/index.test.ts +82 -0
  58. package/tsconfig.json +39 -0
  59. package/typedoc.json +9 -0
  60. package/types/common/index.d.ts +47 -0
  61. package/types/constant/common.constant.d.ts +12 -0
  62. package/types/date/index.d.ts +60 -0
  63. package/types/file/index.d.ts +96 -0
  64. package/types/http/http.d.ts +17 -0
  65. package/types/http/httpEnums.d.ts +53 -0
  66. package/types/index.d.ts +10 -0
  67. package/types/number/index.d.ts +62 -0
  68. package/types/object/index.d.ts +25 -0
  69. package/types/print/index.d.ts +11 -0
  70. package/types/string/index.d.ts +53 -0
  71. package/types/validate/index.d.ts +45 -0
  72. package/types/wecom/wecom.d.ts +3 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * 空值处理
3
+ */
4
+ export declare function formatEmptyValue(value: any, defaultValue?: string): any;
5
+ /**
6
+ * 格式化手机
7
+ #### 使用说明
8
+ * ```
9
+ * formatPhone('18211572781') => '182 1157 2781'
10
+ * formatPhone('18211572781', '-') => '182-1157-2781'
11
+ * ```
12
+ * @param {string | number} phone 手机号
13
+ * @param {string} [separator=' '] 连接符
14
+ */
15
+ export declare function formatPhone(phone: string | number, separator?: string, defaultValue?: string): string | number;
16
+ /**
17
+ * 隐藏手机号
18
+ #### 使用说明
19
+ * ```
20
+ * formatPhoneHide('18211572781') => '182****2781'
21
+ * formatPhoneHide('', '-') => '-'
22
+ * ```
23
+ * @param {string | number} phone 手机号
24
+ * @param {string} defaultValue 没有值放回的默认值
25
+ */
26
+ export declare function formatPhoneHide(phone: string | number, defaultValue?: string): string | number;
27
+ /**
28
+ * 格式化银行卡 (4位一空格)
29
+ #### 使用说明
30
+ * ```
31
+ * formatBank('6282356862823568123') => '6282 3568 6282 3568 123'
32
+ * formatBank('', '-') => '-'
33
+ * ```
34
+ * @param {strubg | number} val 银行卡号
35
+ * @param {string} defaultValue 没有值放回的默认值
36
+ */
37
+ export declare function formatBank(val: string | number, defaultValue?: string): string;
38
+ /**
39
+ * 生成26个字母列表
40
+ #### 使用说明
41
+ * ```
42
+ * generateEnglishLetters() => ['A', ..., 'Z'];
43
+ * ```
44
+ */
45
+ export declare function generateEnglishLetters(): string[];
46
+ /**
47
+ * 驼峰式命名转短横线命名
48
+ *
49
+ * @export
50
+ * @param {*} [string='']
51
+ * @returns
52
+ */
53
+ export declare function humpTurnDashed(string?: string): string;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * validate处理相关
3
+ * @packageDocumentation
4
+ * @module Validate
5
+ * @preferred
6
+ */
7
+ /** 是否是外部网址
8
+ * @param {string} path
9
+ * @returns {Boolean}
10
+ */
11
+ export declare function isExternal(path: string): boolean;
12
+ /**
13
+ * 去掉前后空格
14
+ * @param {*} str
15
+ */
16
+ export declare function trimVal(str: string): string;
17
+ /**
18
+ * 校验 手机
19
+ * @param {*} val
20
+ */
21
+ export declare function isMobile(val: string | number): boolean;
22
+ /**
23
+ * 校验 手机
24
+ * 规则: 以1为开头,总共11位数
25
+ * @export
26
+ * @param {*} val
27
+ * @returns
28
+ */
29
+ export declare function isMobileSimple(val: string | number): boolean;
30
+ /**
31
+ * 校验 固定电话
32
+ * 规则: 必须带区号
33
+ * @param {*} val
34
+ */
35
+ export declare function isTelephone(val: string | number): boolean;
36
+ /**
37
+ * 校验 邮箱
38
+ * @param {*} val
39
+ */
40
+ export declare function isEmail(val: string): boolean;
41
+ /**
42
+ * 校验 QQ
43
+ * @param {*} val
44
+ */
45
+ export declare function isQQ(val: string | number): boolean;
@@ -0,0 +1,3 @@
1
+ export declare function initWWConfig(getJsapiTicket: any): void;
2
+ export declare function handleGetJsapiTicket(getJsapiTicket: any): Promise<unknown>;
3
+ export declare function registerWW(corpid: any, jsapiTicket: any, firstTime?: boolean): void;