@minto-ai/tools 1.0.65 → 1.0.661

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.
@@ -5,9 +5,11 @@ import { default as checkEmpty } from './check-empty';
5
5
  import { default as checkEmptyNotZero } from './check-empty-not-zero';
6
6
  import { default as checkObjectEmpty } from './check-object-empty';
7
7
  import { default as isArray } from './is-array';
8
+ import { default as isBoolean } from './is-boolean';
9
+ import { default as isFunction } from './is-function';
8
10
  import { default as isNullOrUndefined } from './is-null-or-undefined';
9
11
  import { default as isNumber } from './is-number';
10
12
  import { default as isObject } from './is-object';
11
13
  import { default as isString } from './is-string';
12
14
  import { default as isUndefined } from './is-undefined';
13
- export { beParsedAsNumber, canBeParsedAsNumber, checkArrayEmpty, checkEmpty, checkEmptyNotZero, checkObjectEmpty, isArray, isNullOrUndefined, isNumber, isObject, isString, isUndefined, };
15
+ export { beParsedAsNumber, canBeParsedAsNumber, checkArrayEmpty, checkEmpty, checkEmptyNotZero, checkObjectEmpty, isArray, isBoolean, isFunction, isNullOrUndefined, isNumber, isObject, isString, isUndefined, };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 判断输入值是否是一个布尔值。
3
+ *
4
+ * @param value 输入值。
5
+ * @returns 如果输入值是一个布尔值,则返回 true,否则返回 false。
6
+ */
7
+ declare function isBoolean(value: unknown): value is boolean;
8
+ export default isBoolean;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 判断输入值是否是一个函数。
3
+ *
4
+ * @param value 输入值。
5
+ * @returns 如果输入值是一个函数,则返回 true,否则返回 false。
6
+ */
7
+ declare function isFunction<T extends (...args: any[]) => any>(value: unknown): value is T;
8
+ export default isFunction;
@@ -29,3 +29,4 @@ export declare class I18n {
29
29
  t(key: string, fallback?: string): string;
30
30
  }
31
31
  export declare const i18n: I18n;
32
+ export type Locale = 'zh-cn' | 'zh-tw' | 'en' | 'ms' | 'ar' | 'th' | 'vi';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Locale } from './i18n';
1
2
  export * from './array';
2
3
  export * from './browser';
3
4
  export * from './core';
@@ -16,11 +17,11 @@ declare const _default: {
16
17
  * 设置语言
17
18
  * @param locale - 语言代码,支持 'zh-cn', 'zh-tw', 'en', 'ms', 'ar', 'th'、'vi'
18
19
  */
19
- locale(locale: string): void;
20
+ locale(locale: Locale): void;
20
21
  /**
21
22
  * 获取当前语言
22
23
  * @returns 当前语言代码
23
24
  */
24
- getLocale(): string;
25
+ getLocale(): Locale;
25
26
  };
26
27
  export default _default;
package/dist/index.js CHANGED
@@ -13804,6 +13804,12 @@ function checkEmpty(value) {
13804
13804
  function checkEmptyNotZero(value) {
13805
13805
  return checkEmpty(value) && value !== 0;
13806
13806
  }
13807
+ function isBoolean(value) {
13808
+ return typeof value === "boolean";
13809
+ }
13810
+ function isFunction$1(value) {
13811
+ return typeof value === "function";
13812
+ }
13807
13813
  function isNullOrUndefined2(value) {
13808
13814
  return value === null || value === void 0;
13809
13815
  }
@@ -16698,9 +16704,11 @@ export {
16698
16704
  getUuid,
16699
16705
  isAndroid,
16700
16706
  isArray$1 as isArray,
16707
+ isBoolean,
16701
16708
  isCompressFilePath,
16702
16709
  isDocumentFilePath,
16703
16710
  isFilePath,
16711
+ isFunction$1 as isFunction,
16704
16712
  isImageFilePath,
16705
16713
  isIos,
16706
16714
  isMobile,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@minto-ai/tools",
3
3
  "type": "module",
4
- "version": "1.0.65",
4
+ "version": "1.0.661",
5
5
  "description": "明途公共工具库",
6
6
  "author": "hcc",
7
7
  "license": "ISC",