@heyform-inc/utils 1.1.1 → 1.2.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.
package/dist/index.d.mts CHANGED
@@ -7,7 +7,6 @@ import _isFQDN from 'validator/lib/isFQDN';
7
7
  import { IsNumericOptions } from 'validator/lib/isNumeric';
8
8
  import { IsEmailOptions } from 'validator/lib/isEmail';
9
9
  import { IsURLOptions } from 'validator/lib/isURL';
10
- import * as m from 'mime-types';
11
10
  export { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
12
11
  export { deepEqual } from 'fast-equals';
13
12
 
@@ -37,7 +36,7 @@ declare function toInteger(value: unknown, defaults?: number, maxValue?: number)
37
36
  declare const parseNumber: typeof toInteger;
38
37
  declare const toInt: typeof toInteger;
39
38
  declare function toFloat(value: unknown, defaults?: number, maxValue?: number): number | undefined;
40
- declare function toFixed(value: number, precision?: number): string;
39
+ declare function toFixed(value: number, precision?: number): string | undefined;
41
40
  declare function toJSON<T extends object>(str: unknown, defaults?: T): T | undefined;
42
41
  declare const parseJson: typeof toJSON;
43
42
  declare function toIntlNumber(value: number): string;
@@ -131,9 +130,11 @@ declare function ms(arg: string): number | undefined;
131
130
  declare const toSecond: typeof hs;
132
131
  declare const toMillisecond: typeof ms;
133
132
 
133
+ declare function mime(path: string): string | undefined;
134
134
  declare const commonImageMimeTypes: string[];
135
135
  declare const commonFileMimeTypes: string[];
136
- declare const mime: typeof m.lookup;
136
+ declare const IMAGE_MIME_TYPES: string[];
137
+ declare const FILE_MIME_TYPES: string[];
137
138
 
138
139
  declare function nanoid(len?: number): string;
139
140
  declare function nanoidCustomAlphabet(alphabet: string, len?: number): string;
@@ -167,4 +168,4 @@ declare function slugify(text: string, options?: SlugifyOptions): string;
167
168
 
168
169
  declare function type(obj: any): string;
169
170
 
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 };
171
+ export { FILE_MIME_TYPES, IMAGE_MIME_TYPES, 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
@@ -7,7 +7,6 @@ import _isFQDN from 'validator/lib/isFQDN';
7
7
  import { IsNumericOptions } from 'validator/lib/isNumeric';
8
8
  import { IsEmailOptions } from 'validator/lib/isEmail';
9
9
  import { IsURLOptions } from 'validator/lib/isURL';
10
- import * as m from 'mime-types';
11
10
  export { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
12
11
  export { deepEqual } from 'fast-equals';
13
12
 
@@ -37,7 +36,7 @@ declare function toInteger(value: unknown, defaults?: number, maxValue?: number)
37
36
  declare const parseNumber: typeof toInteger;
38
37
  declare const toInt: typeof toInteger;
39
38
  declare function toFloat(value: unknown, defaults?: number, maxValue?: number): number | undefined;
40
- declare function toFixed(value: number, precision?: number): string;
39
+ declare function toFixed(value: number, precision?: number): string | undefined;
41
40
  declare function toJSON<T extends object>(str: unknown, defaults?: T): T | undefined;
42
41
  declare const parseJson: typeof toJSON;
43
42
  declare function toIntlNumber(value: number): string;
@@ -131,9 +130,11 @@ declare function ms(arg: string): number | undefined;
131
130
  declare const toSecond: typeof hs;
132
131
  declare const toMillisecond: typeof ms;
133
132
 
133
+ declare function mime(path: string): string | undefined;
134
134
  declare const commonImageMimeTypes: string[];
135
135
  declare const commonFileMimeTypes: string[];
136
- declare const mime: typeof m.lookup;
136
+ declare const IMAGE_MIME_TYPES: string[];
137
+ declare const FILE_MIME_TYPES: string[];
137
138
 
138
139
  declare function nanoid(len?: number): string;
139
140
  declare function nanoidCustomAlphabet(alphabet: string, len?: number): string;
@@ -167,4 +168,4 @@ declare function slugify(text: string, options?: SlugifyOptions): string;
167
168
 
168
169
  declare function type(obj: any): string;
169
170
 
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 };
171
+ export { FILE_MIME_TYPES, IMAGE_MIME_TYPES, 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 };