@hairy/utils 1.6.0 → 1.6.2
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.ts +73 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,79 @@
|
|
|
1
|
-
export { camelCase, capitalCase, constantCase, dotCase, kebabCase, noCase, pascalCase, pascalSnakeCase, pathCase, sentenceCase, snakeCase, trainCase } from 'change-case';
|
|
2
1
|
export { clone, cloneDeep, concat, debounce, find, isArray, isArrayLike, isBoolean, isDate, isEmpty, isEqual, isError, isFunction, isNaN, isNative, isNull, isNumber, isObject, isPlainObject, isString, isUndefined, join, keys, truncate, uniq, uniqBy, values } from 'lodash-es';
|
|
3
2
|
import Bignumber from 'bignumber.js';
|
|
4
3
|
export { default as Bignumber } from 'bignumber.js';
|
|
5
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Supported locale values. Use `false` to ignore locale.
|
|
7
|
+
* Defaults to `undefined`, which uses the host environment.
|
|
8
|
+
*/
|
|
9
|
+
type Locale = string[] | string | false | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Options used for converting strings to pascal/camel case.
|
|
12
|
+
*/
|
|
13
|
+
interface PascalCaseOptions extends Options {
|
|
14
|
+
mergeAmbiguousCharacters?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Options used for converting strings to any case.
|
|
18
|
+
*/
|
|
19
|
+
interface Options {
|
|
20
|
+
locale?: Locale;
|
|
21
|
+
split?: (value: string) => string[];
|
|
22
|
+
/** @deprecated Pass `split: splitSeparateNumbers` instead. */
|
|
23
|
+
separateNumbers?: boolean;
|
|
24
|
+
delimiter?: string;
|
|
25
|
+
prefixCharacters?: string;
|
|
26
|
+
suffixCharacters?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Convert a string to space separated lower case (`foo bar`).
|
|
30
|
+
*/
|
|
31
|
+
declare function noCase(input: string, options?: Options): string;
|
|
32
|
+
/**
|
|
33
|
+
* Convert a string to camel case (`fooBar`).
|
|
34
|
+
*/
|
|
35
|
+
declare function camelCase(input: string, options?: PascalCaseOptions): string;
|
|
36
|
+
/**
|
|
37
|
+
* Convert a string to pascal case (`FooBar`).
|
|
38
|
+
*/
|
|
39
|
+
declare function pascalCase(input: string, options?: PascalCaseOptions): string;
|
|
40
|
+
/**
|
|
41
|
+
* Convert a string to pascal snake case (`Foo_Bar`).
|
|
42
|
+
*/
|
|
43
|
+
declare function pascalSnakeCase(input: string, options?: Options): string;
|
|
44
|
+
/**
|
|
45
|
+
* Convert a string to capital case (`Foo Bar`).
|
|
46
|
+
*/
|
|
47
|
+
declare function capitalCase(input: string, options?: Options): string;
|
|
48
|
+
/**
|
|
49
|
+
* Convert a string to constant case (`FOO_BAR`).
|
|
50
|
+
*/
|
|
51
|
+
declare function constantCase(input: string, options?: Options): string;
|
|
52
|
+
/**
|
|
53
|
+
* Convert a string to dot case (`foo.bar`).
|
|
54
|
+
*/
|
|
55
|
+
declare function dotCase(input: string, options?: Options): string;
|
|
56
|
+
/**
|
|
57
|
+
* Convert a string to kebab case (`foo-bar`).
|
|
58
|
+
*/
|
|
59
|
+
declare function kebabCase(input: string, options?: Options): string;
|
|
60
|
+
/**
|
|
61
|
+
* Convert a string to path case (`foo/bar`).
|
|
62
|
+
*/
|
|
63
|
+
declare function pathCase(input: string, options?: Options): string;
|
|
64
|
+
/**
|
|
65
|
+
* Convert a string to path case (`Foo bar`).
|
|
66
|
+
*/
|
|
67
|
+
declare function sentenceCase(input: string, options?: Options): string;
|
|
68
|
+
/**
|
|
69
|
+
* Convert a string to snake case (`foo_bar`).
|
|
70
|
+
*/
|
|
71
|
+
declare function snakeCase(input: string, options?: Options): string;
|
|
72
|
+
/**
|
|
73
|
+
* Convert a string to header case (`Foo-Bar`).
|
|
74
|
+
*/
|
|
75
|
+
declare function trainCase(input: string, options?: Options): string;
|
|
76
|
+
|
|
6
77
|
type Numeric = string | number | bigint;
|
|
7
78
|
interface DynamicObject {
|
|
8
79
|
[key: string]: any;
|
|
@@ -245,4 +316,4 @@ declare function riposte<T>(...args: [cond: boolean, value: T][]): T;
|
|
|
245
316
|
declare function unwrap<T extends object>(value: T | (() => T)): T;
|
|
246
317
|
declare function whenever<T, C extends (value: Exclude<T, null | undefined>) => any>(value: T, callback: C): ReturnType<C> | undefined;
|
|
247
318
|
|
|
248
|
-
export { type Arrayable, type Awaitable, BIG_INTS, type BooleanLike, type DecimalOptions, type DeepKeyof, type DeepPartial, type DeepReadonly, type DeepReplace, type DeepRequired, Deferred, type Delimiter, type Dimension, type DynamicObject, type FormatGroupOptions, type FormatNumericOptions, type Key, type Noop, type NumberObject, type Numberish, type Numeric, type NumericObject, type Option, type Pipeline, type StringObject, type SymbolObject, type Typeof, type UnaryFunction, arange, average, compose, cover, decimal, delay, formToObject, formatNumeric, formatSize, formatUnit, getTypeof, gt, gte, integer, isAndroid, isBrowser, isChrome, isEdge, isFF, isFormData, isIE, isIE11, isIE9, isIOS, isMobile, isPhantomJS, isTypeof, isWeex, isWindow, loop, lt, lte, noop, numerfix, objectToForm, pPipe, parseNumeric, percentage, pipe, plus, riposte, unum, unwrap, whenever, zerofill, zeromove };
|
|
319
|
+
export { type Arrayable, type Awaitable, BIG_INTS, type BooleanLike, type DecimalOptions, type DeepKeyof, type DeepPartial, type DeepReadonly, type DeepReplace, type DeepRequired, Deferred, type Delimiter, type Dimension, type DynamicObject, type FormatGroupOptions, type FormatNumericOptions, type Key, type Noop, type NumberObject, type Numberish, type Numeric, type NumericObject, type Option, type Pipeline, type StringObject, type SymbolObject, type Typeof, type UnaryFunction, arange, average, camelCase, capitalCase, compose, constantCase, cover, decimal, delay, dotCase, formToObject, formatNumeric, formatSize, formatUnit, getTypeof, gt, gte, integer, isAndroid, isBrowser, isChrome, isEdge, isFF, isFormData, isIE, isIE11, isIE9, isIOS, isMobile, isPhantomJS, isTypeof, isWeex, isWindow, kebabCase, loop, lt, lte, noCase, noop, numerfix, objectToForm, pPipe, parseNumeric, pascalCase, pascalSnakeCase, pathCase, percentage, pipe, plus, riposte, sentenceCase, snakeCase, trainCase, unum, unwrap, whenever, zerofill, zeromove };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hairy/utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.2",
|
|
5
5
|
"description": "Library for anywhere",
|
|
6
6
|
"author": "Hairyf <wwu710632@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@types/lodash-es": "^4.17.12",
|
|
25
26
|
"bignumber.js": "^9.1.2",
|
|
26
27
|
"p-pipe": "^4.0.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@types/lodash-es": "^4.17.12",
|
|
30
30
|
"change-case": "^5.4.4",
|
|
31
31
|
"lodash-es": "^4.17.21"
|
|
32
32
|
},
|