@heyform-inc/utils 1.0.8 → 1.1.0

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.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from 'deep-object-diff';
2
+ import { IParseOptions, IStringifyOptions } from 'qs';
3
+ export { default as qs } from 'qs';
2
4
  import dayjs, { QUnitType, OpUnitType } from 'dayjs';
3
- import visUUID from 'validator/lib/isUUID';
4
- import visFQDN from 'validator/lib/isFQDN';
5
+ import _isUUID from 'validator/lib/isUUID';
6
+ import _isFQDN from 'validator/lib/isFQDN';
5
7
  import { IsNumericOptions } from 'validator/lib/isNumeric';
6
8
  import { IsEmailOptions } from 'validator/lib/isEmail';
7
9
  import { IsURLOptions } from 'validator/lib/isURL';
@@ -9,150 +11,160 @@ import * as m from 'mime-types';
9
11
  export { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
10
12
  export { deepEqual } from 'fast-equals';
11
13
 
12
- declare function parseBytes(value: string | number): number | undefined;
13
- declare function bytes(size: string): number | undefined;
14
+ declare function parseBytes(value: string | number): number | undefined;
15
+ declare function bytes(size: string): number | undefined;
14
16
  declare function formatBytes(value: string | number): string;
15
17
 
16
18
  declare function clone<T>(obj: T): T;
17
19
 
18
- declare function isHexColor(color: string): boolean;
19
- declare function isRgba(color: string): boolean;
20
- declare function isRgb(color: string): boolean;
21
- declare function hexToRgb(hex: string): number[];
22
- declare function isDarkColor(hex: string): boolean;
23
- declare function isLightColor(hex: string): boolean;
24
- declare function colorBrightness(hex: string): number;
25
- declare function rgbToHex([r, g, b]: number[]): string;
26
- declare function alpha(hex: string, alpha: number): string;
27
- declare function lighten(hex: string, alpha: number): string;
28
- declare function darken(hex: string, alpha: number): string;
29
- declare function invert(hex: string): string;
20
+ declare function isHexColor(color: string): boolean;
21
+ declare function isRgba(color: string): boolean;
22
+ declare function isRgb(color: string): boolean;
23
+ declare function hexToRgb(hex: string): number[];
24
+ declare function isDarkColor(hex: string): boolean;
25
+ declare function isLightColor(hex: string): boolean;
26
+ declare function colorBrightness(hex: string): number;
27
+ declare function rgbToHex([r, g, b]: number[]): string;
28
+ declare function alpha(hex: string, alpha: number): string;
29
+ declare function lighten(hex: string, alpha: number): string;
30
+ declare function darken(hex: string, alpha: number): string;
31
+ declare function invert(hex: string): string;
30
32
  declare function alphaHexToRgb(hex: string, alpha: number, backgroundHex: string): number[];
31
33
 
32
34
  declare function toBool(value: unknown, defaults?: boolean): boolean;
35
+ declare const parseBool: typeof toBool;
36
+ declare function toInteger(value: unknown, defaults?: number, maxValue?: number): number | undefined;
37
+ declare const parseNumber: typeof toInteger;
38
+ declare const toInt: typeof toInteger;
39
+ declare function toFloat(value: unknown, defaults?: number, maxValue?: number): number | undefined;
40
+ declare function toFixed(value: number, precision?: number): string;
41
+ declare function toJSON<T extends object>(str: unknown, defaults?: T): T | undefined;
42
+ declare const parseJson: typeof toJSON;
43
+ declare function toIntlNumber(value: number): string;
44
+ interface ToDurationOptions {
45
+ hideOnZeroValue?: boolean;
46
+ padNumber?: boolean;
47
+ hourUnit?: string;
48
+ minuteUnit?: string;
49
+ secondUnit?: string;
50
+ }
51
+ declare function toDuration(value: number, options?: ToDurationOptions): string;
52
+ declare function toURLParams<T extends object>(value: string, options?: IParseOptions): T;
53
+ declare function toURLQuery(value: Record<string | number, any>, baseUri?: string, options?: IStringifyOptions): string;
54
+ declare function htmlToText(html: string, limit?: number): string;
33
55
 
34
- declare function timestamp(): number;
35
- declare function date(str?: string, format?: string): dayjs.Dayjs;
36
- declare function unixDate(t: number): dayjs.Dayjs;
37
- declare function isDateExpired(start: number, end: number, expire: string): boolean;
38
- declare function unixDiff(start: number, end: number, unit?: QUnitType | OpUnitType): number;
56
+ declare function timestamp(): number;
57
+ declare function date(str?: string, format?: string): dayjs.Dayjs;
58
+ declare function unixDate(t: number): dayjs.Dayjs;
59
+ declare function isDateExpired(start: number, end: number, expire: string): boolean;
60
+ declare function unixDiff(start: number, end: number, unit?: QUnitType | OpUnitType): number;
39
61
  declare function datePeriod(start: number, value?: number, unit?: OpUnitType): number;
40
62
 
41
- declare function isBoolean(arg: any): boolean;
42
- declare function isString(arg: any): boolean;
43
- declare function isNumber(arg: any): boolean;
44
- declare function isValidArray(arg: any): boolean;
45
- declare function isNan(arg: any): boolean;
46
- declare function isSet(arg: any): boolean;
47
- declare function isMap(arg: any): boolean;
48
- declare function isSymbol(arg: any): boolean;
49
- declare function isObject(arg: any): boolean;
50
- declare function isDate(arg: any): boolean;
51
- declare function isRegExp(arg: any): boolean;
52
- declare function isError(arg: any): boolean;
53
- declare function isFunction(arg: any): boolean;
54
- declare function isNull(arg: any): boolean;
55
- declare function isUndefined(arg: any): boolean;
56
- declare function isNil(arg: any): boolean;
57
- declare function isPlainObject(arg: any): boolean;
58
- declare function isEmpty(arg: any): boolean;
59
- declare function isValid(arg: any): boolean;
60
- declare function isEqual(arg1: any, arg2: any): boolean;
61
- declare function isTrue(arg1: any): boolean;
62
- declare function isFalse(arg1: any): boolean;
63
- declare function isBool(arg: any): boolean;
64
- declare function isFormData(arg: any): boolean;
65
- declare function uniqueArray(arg: any): any[];
66
- declare function isNumeric(arg: any, options?: IsNumericOptions): boolean;
67
- declare function isURL(arg: any, options?: IsURLOptions): boolean;
68
- declare function isEmail(arg: any, options?: IsEmailOptions): boolean;
69
- declare const _default$1: {
70
- isUUID: typeof visUUID;
71
- isFQDN: typeof visFQDN;
72
- isBoolean: typeof isBoolean;
73
- isString: typeof isString;
74
- isNumber: typeof isNumber;
75
- isNumeric: typeof isNumeric;
76
- isArray: (arg: any) => arg is any[];
77
- isValidArray: typeof isValidArray;
78
- isNan: typeof isNan;
79
- isSet: typeof isSet;
80
- isMap: typeof isMap;
81
- isSymbol: typeof isSymbol;
82
- isObject: typeof isObject;
83
- isDate: typeof isDate;
84
- isRegExp: typeof isRegExp;
85
- isError: typeof isError;
86
- isFunction: typeof isFunction;
87
- isNull: typeof isNull;
88
- isUndefined: typeof isUndefined;
89
- isNil: typeof isNil;
90
- isPlainObject: typeof isPlainObject;
91
- isEmpty: typeof isEmpty;
92
- isValid: typeof isValid;
93
- isEqual: typeof isEqual;
94
- isTrue: typeof isTrue;
95
- isFalse: typeof isFalse;
96
- isBool: typeof isBool;
97
- isURL: typeof isURL;
98
- isEmail: typeof isEmail;
99
- isFormData: typeof isFormData;
100
- uniqueArray: typeof uniqueArray;
63
+ declare function isBoolean(arg: any): boolean;
64
+ declare function isString(arg: any): boolean;
65
+ declare function isNumber(arg: any): boolean;
66
+ declare function isValidArray(arg: any): boolean;
67
+ declare function isNan(arg: any): boolean;
68
+ declare function isSet(arg: any): boolean;
69
+ declare function isWeakSet(arg: any): boolean;
70
+ declare function isMap(arg: any): boolean;
71
+ declare function isWeakMap(arg: any): boolean;
72
+ declare function isSymbol(arg: any): boolean;
73
+ declare function isObject(arg: any): boolean;
74
+ declare function isDate(arg: any): boolean;
75
+ declare function isRegExp(arg: any): boolean;
76
+ declare function isError(arg: any): boolean;
77
+ declare function isFunction(arg: any): boolean;
78
+ declare function isNull(arg: any): boolean;
79
+ declare function isUndefined(arg: any): boolean;
80
+ declare function isNil(arg: any): boolean;
81
+ declare function isPlainObject(arg: any): boolean;
82
+ declare function isEmpty(arg: any): boolean;
83
+ declare function isValid(arg: any): boolean;
84
+ declare function isEqual(arg1: any, arg2: any): boolean;
85
+ declare function isTrue(arg1: any): boolean;
86
+ declare function isFalse(arg1: any): boolean;
87
+ declare function isBool(arg: any): boolean;
88
+ declare function isFormData(arg: any): boolean;
89
+ declare function uniqueArray(arg: any): any[];
90
+ declare function isNumeric(arg: any, options?: IsNumericOptions): boolean;
91
+ declare function isURL(arg: any, options?: IsURLOptions): boolean;
92
+ declare function isEmail(arg: any, options?: IsEmailOptions): boolean;
93
+ declare const _default: {
94
+ isUUID: typeof _isUUID;
95
+ isFQDN: typeof _isFQDN;
96
+ isBoolean: typeof isBoolean;
97
+ isString: typeof isString;
98
+ isNumber: typeof isNumber;
99
+ isNumeric: typeof isNumeric;
100
+ isArray: (arg: any) => arg is any[];
101
+ isValidArray: typeof isValidArray;
102
+ isNan: typeof isNan;
103
+ isSet: typeof isSet;
104
+ isMap: typeof isMap;
105
+ isWeakSet: typeof isWeakSet;
106
+ isWeakMap: typeof isWeakMap;
107
+ isSymbol: typeof isSymbol;
108
+ isObject: typeof isObject;
109
+ isDate: typeof isDate;
110
+ isRegExp: typeof isRegExp;
111
+ isError: typeof isError;
112
+ isFunction: typeof isFunction;
113
+ isNull: typeof isNull;
114
+ isUndefined: typeof isUndefined;
115
+ isNil: typeof isNil;
116
+ isPlainObject: typeof isPlainObject;
117
+ isEmpty: typeof isEmpty;
118
+ isValid: typeof isValid;
119
+ isEqual: typeof isEqual;
120
+ isTrue: typeof isTrue;
121
+ isFalse: typeof isFalse;
122
+ isBool: typeof isBool;
123
+ isURL: typeof isURL;
124
+ isEmail: typeof isEmail;
125
+ isFormData: typeof isFormData;
126
+ uniqueArray: typeof uniqueArray;
101
127
  };
102
128
 
103
- declare function hs(arg: string): number | undefined;
129
+ declare function hs(arg: string): number | undefined;
104
130
  declare function ms(arg: string): number | undefined;
131
+ declare const toSecond: typeof hs;
132
+ declare const toMillisecond: typeof ms;
105
133
 
106
- declare const commonImageMimeTypes: string[];
107
- declare const commonFileMimeTypes: string[];
134
+ declare const commonImageMimeTypes: string[];
135
+ declare const commonFileMimeTypes: string[];
108
136
  declare const mime: typeof m.lookup;
109
137
 
110
- declare function nanoid(len?: number): string;
138
+ declare function nanoid(len?: number): string;
111
139
  declare function nanoidCustomAlphabet(alphabet: string, len?: number): string;
112
140
 
113
- declare function pickObject(target: Record<string, any>, fields: Array<string | string[]>, excludes?: Array<string>): Record<string, any>;
114
- declare function pickValidValues<T = string | number | boolean>(target: Record<string, T>, fields: Array<string | string[]>): Record<string, T>;
115
- declare function removeObjectNil(target: Record<string, any>): Record<string, any>;
141
+ declare function pickObject(target: Record<string, any>, fields: Array<string | string[]>, excludes?: Array<string>): Record<string, any>;
142
+ declare function excludeObject(target: Record<string, any>, excludes?: Array<string>): Record<string, any>;
143
+ declare function pickValidValues<T = string | number | boolean>(target: Record<string, T>, fields: Array<string | string[]>): Record<string, T>;
144
+ declare function removeObjectNil(target: Record<string, any>): Record<string, any>;
116
145
  declare function copyObjectValues(target: Record<string, any>, dist: Record<string, any>, keyMaps: Array<string | string[]>): void;
117
146
 
118
- declare function parseJson(str: string, defaultValue?: any): any;
119
- declare function parseBool(arg: any, defaultValue?: boolean): boolean;
120
- declare function parseNumber(arg: any, defaultValue?: number, maxValue?: number): number | undefined;
121
- declare function htmlToText(html: string, limit?: number): string;
122
-
123
- interface QsOptions {
124
- encode?: boolean;
125
- decode?: boolean;
126
- separator?: string;
127
- }
128
- declare function stringify(arg: Record<string, any>, options?: QsOptions): string;
129
- declare function parse(str: string, options?: QsOptions): Record<string, any>;
130
- declare const _default: {
131
- stringify: typeof stringify;
132
- parse: typeof parse;
133
- };
134
-
135
- declare enum RandomType {
136
- LOWER = 0,
137
- UPPER = 1,
138
- NUMERIC = 2,
139
- HEXIC = 3,
140
- LOWER_NUMERIC = 4,
141
- UPPER_NUMERIC = 5,
142
- ALPHANUMERIC = 6
143
- }
147
+ declare enum RandomType {
148
+ LOWER = 0,
149
+ UPPER = 1,
150
+ NUMERIC = 2,
151
+ HEXIC = 3,
152
+ LOWER_NUMERIC = 4,
153
+ UPPER_NUMERIC = 5,
154
+ ALPHANUMERIC = 6
155
+ }
144
156
  declare function random(len?: number, type?: RandomType): string;
145
157
 
146
- interface SlugifyOptions {
147
- replacement?: string;
148
- remove?: RegExp;
149
- lower?: boolean;
150
- strict?: boolean;
151
- locale?: string;
152
- trim?: boolean;
153
- }
158
+ interface SlugifyOptions {
159
+ replacement?: string;
160
+ remove?: RegExp;
161
+ lower?: boolean;
162
+ strict?: boolean;
163
+ locale?: string;
164
+ trim?: boolean;
165
+ }
154
166
  declare function slugify(text: string, options?: SlugifyOptions): string;
155
167
 
156
168
  declare function type(obj: any): string;
157
169
 
158
- export { RandomType, type SlugifyOptions, alpha, alphaHexToRgb, bytes, clone, colorBrightness, commonFileMimeTypes, commonImageMimeTypes, copyObjectValues, darken, date, datePeriod, formatBytes, _default$1 as helper, hexToRgb, hs, htmlToText, invert, isDarkColor, isDateExpired, isHexColor, isLightColor, isRgb, isRgba, lighten, mime, ms, nanoid, nanoidCustomAlphabet, parseBool, parseBytes, parseJson, parseNumber, pickObject, pickValidValues, _default as qs, random, removeObjectNil, rgbToHex, slugify, timestamp, toBool, type, unixDate, unixDiff };
170
+ export { RandomType, type SlugifyOptions, alpha, alphaHexToRgb, bytes, clone, colorBrightness, commonFileMimeTypes, commonImageMimeTypes, copyObjectValues, darken, date, datePeriod, excludeObject, formatBytes, _default as helper, hexToRgb, hs, htmlToText, invert, isDarkColor, isDateExpired, isHexColor, isLightColor, isRgb, isRgba, lighten, mime, ms, nanoid, nanoidCustomAlphabet, parseBool, parseBytes, parseJson, parseNumber, pickObject, pickValidValues, random, removeObjectNil, rgbToHex, slugify, timestamp, toBool, toDuration, toFixed, toFloat, toInt, toInteger, toIntlNumber, toJSON, toMillisecond, toSecond, toURLParams, toURLQuery, type, unixDate, unixDiff };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from 'deep-object-diff';
2
+ import { IParseOptions, IStringifyOptions } from 'qs';
3
+ export { default as qs } from 'qs';
2
4
  import dayjs, { QUnitType, OpUnitType } from 'dayjs';
3
- import visUUID from 'validator/lib/isUUID';
4
- import visFQDN from 'validator/lib/isFQDN';
5
+ import _isUUID from 'validator/lib/isUUID';
6
+ import _isFQDN from 'validator/lib/isFQDN';
5
7
  import { IsNumericOptions } from 'validator/lib/isNumeric';
6
8
  import { IsEmailOptions } from 'validator/lib/isEmail';
7
9
  import { IsURLOptions } from 'validator/lib/isURL';
@@ -9,150 +11,160 @@ import * as m from 'mime-types';
9
11
  export { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
10
12
  export { deepEqual } from 'fast-equals';
11
13
 
12
- declare function parseBytes(value: string | number): number | undefined;
13
- declare function bytes(size: string): number | undefined;
14
+ declare function parseBytes(value: string | number): number | undefined;
15
+ declare function bytes(size: string): number | undefined;
14
16
  declare function formatBytes(value: string | number): string;
15
17
 
16
18
  declare function clone<T>(obj: T): T;
17
19
 
18
- declare function isHexColor(color: string): boolean;
19
- declare function isRgba(color: string): boolean;
20
- declare function isRgb(color: string): boolean;
21
- declare function hexToRgb(hex: string): number[];
22
- declare function isDarkColor(hex: string): boolean;
23
- declare function isLightColor(hex: string): boolean;
24
- declare function colorBrightness(hex: string): number;
25
- declare function rgbToHex([r, g, b]: number[]): string;
26
- declare function alpha(hex: string, alpha: number): string;
27
- declare function lighten(hex: string, alpha: number): string;
28
- declare function darken(hex: string, alpha: number): string;
29
- declare function invert(hex: string): string;
20
+ declare function isHexColor(color: string): boolean;
21
+ declare function isRgba(color: string): boolean;
22
+ declare function isRgb(color: string): boolean;
23
+ declare function hexToRgb(hex: string): number[];
24
+ declare function isDarkColor(hex: string): boolean;
25
+ declare function isLightColor(hex: string): boolean;
26
+ declare function colorBrightness(hex: string): number;
27
+ declare function rgbToHex([r, g, b]: number[]): string;
28
+ declare function alpha(hex: string, alpha: number): string;
29
+ declare function lighten(hex: string, alpha: number): string;
30
+ declare function darken(hex: string, alpha: number): string;
31
+ declare function invert(hex: string): string;
30
32
  declare function alphaHexToRgb(hex: string, alpha: number, backgroundHex: string): number[];
31
33
 
32
34
  declare function toBool(value: unknown, defaults?: boolean): boolean;
35
+ declare const parseBool: typeof toBool;
36
+ declare function toInteger(value: unknown, defaults?: number, maxValue?: number): number | undefined;
37
+ declare const parseNumber: typeof toInteger;
38
+ declare const toInt: typeof toInteger;
39
+ declare function toFloat(value: unknown, defaults?: number, maxValue?: number): number | undefined;
40
+ declare function toFixed(value: number, precision?: number): string;
41
+ declare function toJSON<T extends object>(str: unknown, defaults?: T): T | undefined;
42
+ declare const parseJson: typeof toJSON;
43
+ declare function toIntlNumber(value: number): string;
44
+ interface ToDurationOptions {
45
+ hideOnZeroValue?: boolean;
46
+ padNumber?: boolean;
47
+ hourUnit?: string;
48
+ minuteUnit?: string;
49
+ secondUnit?: string;
50
+ }
51
+ declare function toDuration(value: number, options?: ToDurationOptions): string;
52
+ declare function toURLParams<T extends object>(value: string, options?: IParseOptions): T;
53
+ declare function toURLQuery(value: Record<string | number, any>, baseUri?: string, options?: IStringifyOptions): string;
54
+ declare function htmlToText(html: string, limit?: number): string;
33
55
 
34
- declare function timestamp(): number;
35
- declare function date(str?: string, format?: string): dayjs.Dayjs;
36
- declare function unixDate(t: number): dayjs.Dayjs;
37
- declare function isDateExpired(start: number, end: number, expire: string): boolean;
38
- declare function unixDiff(start: number, end: number, unit?: QUnitType | OpUnitType): number;
56
+ declare function timestamp(): number;
57
+ declare function date(str?: string, format?: string): dayjs.Dayjs;
58
+ declare function unixDate(t: number): dayjs.Dayjs;
59
+ declare function isDateExpired(start: number, end: number, expire: string): boolean;
60
+ declare function unixDiff(start: number, end: number, unit?: QUnitType | OpUnitType): number;
39
61
  declare function datePeriod(start: number, value?: number, unit?: OpUnitType): number;
40
62
 
41
- declare function isBoolean(arg: any): boolean;
42
- declare function isString(arg: any): boolean;
43
- declare function isNumber(arg: any): boolean;
44
- declare function isValidArray(arg: any): boolean;
45
- declare function isNan(arg: any): boolean;
46
- declare function isSet(arg: any): boolean;
47
- declare function isMap(arg: any): boolean;
48
- declare function isSymbol(arg: any): boolean;
49
- declare function isObject(arg: any): boolean;
50
- declare function isDate(arg: any): boolean;
51
- declare function isRegExp(arg: any): boolean;
52
- declare function isError(arg: any): boolean;
53
- declare function isFunction(arg: any): boolean;
54
- declare function isNull(arg: any): boolean;
55
- declare function isUndefined(arg: any): boolean;
56
- declare function isNil(arg: any): boolean;
57
- declare function isPlainObject(arg: any): boolean;
58
- declare function isEmpty(arg: any): boolean;
59
- declare function isValid(arg: any): boolean;
60
- declare function isEqual(arg1: any, arg2: any): boolean;
61
- declare function isTrue(arg1: any): boolean;
62
- declare function isFalse(arg1: any): boolean;
63
- declare function isBool(arg: any): boolean;
64
- declare function isFormData(arg: any): boolean;
65
- declare function uniqueArray(arg: any): any[];
66
- declare function isNumeric(arg: any, options?: IsNumericOptions): boolean;
67
- declare function isURL(arg: any, options?: IsURLOptions): boolean;
68
- declare function isEmail(arg: any, options?: IsEmailOptions): boolean;
69
- declare const _default$1: {
70
- isUUID: typeof visUUID;
71
- isFQDN: typeof visFQDN;
72
- isBoolean: typeof isBoolean;
73
- isString: typeof isString;
74
- isNumber: typeof isNumber;
75
- isNumeric: typeof isNumeric;
76
- isArray: (arg: any) => arg is any[];
77
- isValidArray: typeof isValidArray;
78
- isNan: typeof isNan;
79
- isSet: typeof isSet;
80
- isMap: typeof isMap;
81
- isSymbol: typeof isSymbol;
82
- isObject: typeof isObject;
83
- isDate: typeof isDate;
84
- isRegExp: typeof isRegExp;
85
- isError: typeof isError;
86
- isFunction: typeof isFunction;
87
- isNull: typeof isNull;
88
- isUndefined: typeof isUndefined;
89
- isNil: typeof isNil;
90
- isPlainObject: typeof isPlainObject;
91
- isEmpty: typeof isEmpty;
92
- isValid: typeof isValid;
93
- isEqual: typeof isEqual;
94
- isTrue: typeof isTrue;
95
- isFalse: typeof isFalse;
96
- isBool: typeof isBool;
97
- isURL: typeof isURL;
98
- isEmail: typeof isEmail;
99
- isFormData: typeof isFormData;
100
- uniqueArray: typeof uniqueArray;
63
+ declare function isBoolean(arg: any): boolean;
64
+ declare function isString(arg: any): boolean;
65
+ declare function isNumber(arg: any): boolean;
66
+ declare function isValidArray(arg: any): boolean;
67
+ declare function isNan(arg: any): boolean;
68
+ declare function isSet(arg: any): boolean;
69
+ declare function isWeakSet(arg: any): boolean;
70
+ declare function isMap(arg: any): boolean;
71
+ declare function isWeakMap(arg: any): boolean;
72
+ declare function isSymbol(arg: any): boolean;
73
+ declare function isObject(arg: any): boolean;
74
+ declare function isDate(arg: any): boolean;
75
+ declare function isRegExp(arg: any): boolean;
76
+ declare function isError(arg: any): boolean;
77
+ declare function isFunction(arg: any): boolean;
78
+ declare function isNull(arg: any): boolean;
79
+ declare function isUndefined(arg: any): boolean;
80
+ declare function isNil(arg: any): boolean;
81
+ declare function isPlainObject(arg: any): boolean;
82
+ declare function isEmpty(arg: any): boolean;
83
+ declare function isValid(arg: any): boolean;
84
+ declare function isEqual(arg1: any, arg2: any): boolean;
85
+ declare function isTrue(arg1: any): boolean;
86
+ declare function isFalse(arg1: any): boolean;
87
+ declare function isBool(arg: any): boolean;
88
+ declare function isFormData(arg: any): boolean;
89
+ declare function uniqueArray(arg: any): any[];
90
+ declare function isNumeric(arg: any, options?: IsNumericOptions): boolean;
91
+ declare function isURL(arg: any, options?: IsURLOptions): boolean;
92
+ declare function isEmail(arg: any, options?: IsEmailOptions): boolean;
93
+ declare const _default: {
94
+ isUUID: typeof _isUUID;
95
+ isFQDN: typeof _isFQDN;
96
+ isBoolean: typeof isBoolean;
97
+ isString: typeof isString;
98
+ isNumber: typeof isNumber;
99
+ isNumeric: typeof isNumeric;
100
+ isArray: (arg: any) => arg is any[];
101
+ isValidArray: typeof isValidArray;
102
+ isNan: typeof isNan;
103
+ isSet: typeof isSet;
104
+ isMap: typeof isMap;
105
+ isWeakSet: typeof isWeakSet;
106
+ isWeakMap: typeof isWeakMap;
107
+ isSymbol: typeof isSymbol;
108
+ isObject: typeof isObject;
109
+ isDate: typeof isDate;
110
+ isRegExp: typeof isRegExp;
111
+ isError: typeof isError;
112
+ isFunction: typeof isFunction;
113
+ isNull: typeof isNull;
114
+ isUndefined: typeof isUndefined;
115
+ isNil: typeof isNil;
116
+ isPlainObject: typeof isPlainObject;
117
+ isEmpty: typeof isEmpty;
118
+ isValid: typeof isValid;
119
+ isEqual: typeof isEqual;
120
+ isTrue: typeof isTrue;
121
+ isFalse: typeof isFalse;
122
+ isBool: typeof isBool;
123
+ isURL: typeof isURL;
124
+ isEmail: typeof isEmail;
125
+ isFormData: typeof isFormData;
126
+ uniqueArray: typeof uniqueArray;
101
127
  };
102
128
 
103
- declare function hs(arg: string): number | undefined;
129
+ declare function hs(arg: string): number | undefined;
104
130
  declare function ms(arg: string): number | undefined;
131
+ declare const toSecond: typeof hs;
132
+ declare const toMillisecond: typeof ms;
105
133
 
106
- declare const commonImageMimeTypes: string[];
107
- declare const commonFileMimeTypes: string[];
134
+ declare const commonImageMimeTypes: string[];
135
+ declare const commonFileMimeTypes: string[];
108
136
  declare const mime: typeof m.lookup;
109
137
 
110
- declare function nanoid(len?: number): string;
138
+ declare function nanoid(len?: number): string;
111
139
  declare function nanoidCustomAlphabet(alphabet: string, len?: number): string;
112
140
 
113
- declare function pickObject(target: Record<string, any>, fields: Array<string | string[]>, excludes?: Array<string>): Record<string, any>;
114
- declare function pickValidValues<T = string | number | boolean>(target: Record<string, T>, fields: Array<string | string[]>): Record<string, T>;
115
- declare function removeObjectNil(target: Record<string, any>): Record<string, any>;
141
+ declare function pickObject(target: Record<string, any>, fields: Array<string | string[]>, excludes?: Array<string>): Record<string, any>;
142
+ declare function excludeObject(target: Record<string, any>, excludes?: Array<string>): Record<string, any>;
143
+ declare function pickValidValues<T = string | number | boolean>(target: Record<string, T>, fields: Array<string | string[]>): Record<string, T>;
144
+ declare function removeObjectNil(target: Record<string, any>): Record<string, any>;
116
145
  declare function copyObjectValues(target: Record<string, any>, dist: Record<string, any>, keyMaps: Array<string | string[]>): void;
117
146
 
118
- declare function parseJson(str: string, defaultValue?: any): any;
119
- declare function parseBool(arg: any, defaultValue?: boolean): boolean;
120
- declare function parseNumber(arg: any, defaultValue?: number, maxValue?: number): number | undefined;
121
- declare function htmlToText(html: string, limit?: number): string;
122
-
123
- interface QsOptions {
124
- encode?: boolean;
125
- decode?: boolean;
126
- separator?: string;
127
- }
128
- declare function stringify(arg: Record<string, any>, options?: QsOptions): string;
129
- declare function parse(str: string, options?: QsOptions): Record<string, any>;
130
- declare const _default: {
131
- stringify: typeof stringify;
132
- parse: typeof parse;
133
- };
134
-
135
- declare enum RandomType {
136
- LOWER = 0,
137
- UPPER = 1,
138
- NUMERIC = 2,
139
- HEXIC = 3,
140
- LOWER_NUMERIC = 4,
141
- UPPER_NUMERIC = 5,
142
- ALPHANUMERIC = 6
143
- }
147
+ declare enum RandomType {
148
+ LOWER = 0,
149
+ UPPER = 1,
150
+ NUMERIC = 2,
151
+ HEXIC = 3,
152
+ LOWER_NUMERIC = 4,
153
+ UPPER_NUMERIC = 5,
154
+ ALPHANUMERIC = 6
155
+ }
144
156
  declare function random(len?: number, type?: RandomType): string;
145
157
 
146
- interface SlugifyOptions {
147
- replacement?: string;
148
- remove?: RegExp;
149
- lower?: boolean;
150
- strict?: boolean;
151
- locale?: string;
152
- trim?: boolean;
153
- }
158
+ interface SlugifyOptions {
159
+ replacement?: string;
160
+ remove?: RegExp;
161
+ lower?: boolean;
162
+ strict?: boolean;
163
+ locale?: string;
164
+ trim?: boolean;
165
+ }
154
166
  declare function slugify(text: string, options?: SlugifyOptions): string;
155
167
 
156
168
  declare function type(obj: any): string;
157
169
 
158
- export { RandomType, type SlugifyOptions, alpha, alphaHexToRgb, bytes, clone, colorBrightness, commonFileMimeTypes, commonImageMimeTypes, copyObjectValues, darken, date, datePeriod, formatBytes, _default$1 as helper, hexToRgb, hs, htmlToText, invert, isDarkColor, isDateExpired, isHexColor, isLightColor, isRgb, isRgba, lighten, mime, ms, nanoid, nanoidCustomAlphabet, parseBool, parseBytes, parseJson, parseNumber, pickObject, pickValidValues, _default as qs, random, removeObjectNil, rgbToHex, slugify, timestamp, toBool, type, unixDate, unixDiff };
170
+ export { RandomType, type SlugifyOptions, alpha, alphaHexToRgb, bytes, clone, colorBrightness, commonFileMimeTypes, commonImageMimeTypes, copyObjectValues, darken, date, datePeriod, excludeObject, formatBytes, _default as helper, hexToRgb, hs, htmlToText, invert, isDarkColor, isDateExpired, isHexColor, isLightColor, isRgb, isRgba, lighten, mime, ms, nanoid, nanoidCustomAlphabet, parseBool, parseBytes, parseJson, parseNumber, pickObject, pickValidValues, random, removeObjectNil, rgbToHex, slugify, timestamp, toBool, toDuration, toFixed, toFloat, toInt, toInteger, toIntlNumber, toJSON, toMillisecond, toSecond, toURLParams, toURLQuery, type, unixDate, unixDiff };