@stacksjs/strings 0.65.0 → 0.67.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/case.d.ts +80 -2
- package/dist/detect-indent.d.ts +6 -0
- package/dist/detect-newline.d.ts +2 -0
- package/dist/index.js +963 -161
- package/dist/pluralize.d.ts +19 -22
- package/dist/slug.d.ts +12 -0
- package/dist/sponge-case.d.ts +1 -0
- package/dist/string.d.ts +1 -1
- package/dist/swap-case.d.ts +1 -0
- package/dist/title-case.d.ts +13 -0
- package/dist/utils.d.ts +3 -2
- package/package.json +5 -15
- package/dist/index.js.map +0 -179
- package/dist/types.d.ts +0 -1
- package/src/case.ts +0 -31
- package/src/helpers.ts +0 -3
- package/src/index.ts +0 -2
- package/src/is.ts +0 -170
- package/src/macro.ts +0 -135
- package/src/pluralize.ts +0 -35
- package/src/string.ts +0 -7
- package/src/types.ts +0 -4
- package/src/utils.ts +0 -116
package/dist/case.d.ts
CHANGED
|
@@ -8,5 +8,83 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function capitalize(str: string): string;
|
|
10
10
|
export declare function lowercase(str: string): string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Supported locale values. Use `false` to ignore locale.
|
|
13
|
+
* Defaults to `undefined`, which uses the host environment.
|
|
14
|
+
*/
|
|
15
|
+
export type Locale = string[] | string | false | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Options used for converting strings to pascal/camel case.
|
|
18
|
+
*/
|
|
19
|
+
export interface PascalCaseOptions extends CaseOptions {
|
|
20
|
+
mergeAmbiguousCharacters?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Options used for converting strings to any case.
|
|
24
|
+
*/
|
|
25
|
+
export interface CaseOptions {
|
|
26
|
+
locale?: Locale;
|
|
27
|
+
split?: (value: string) => string[];
|
|
28
|
+
delimiter?: string;
|
|
29
|
+
prefixCharacters?: string;
|
|
30
|
+
suffixCharacters?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Split any cased input strings into an array of words.
|
|
34
|
+
*/
|
|
35
|
+
export declare function split(value: string): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Split the input string into an array of words, separating numbers.
|
|
38
|
+
*/
|
|
39
|
+
export declare function splitSeparateNumbers(value: string): string[];
|
|
40
|
+
/**
|
|
41
|
+
* Convert a string to space separated lower case (`foo bar`).
|
|
42
|
+
*/
|
|
43
|
+
export declare function noCase(input: string, options?: CaseOptions): string;
|
|
44
|
+
/**
|
|
45
|
+
* Convert a string to camel case (`fooBar`).
|
|
46
|
+
*/
|
|
47
|
+
export declare function camelCase(input: string, options?: PascalCaseOptions): string;
|
|
48
|
+
/**
|
|
49
|
+
* Convert a string to pascal case (`FooBar`).
|
|
50
|
+
*/
|
|
51
|
+
export declare function pascalCase(input: string, options?: PascalCaseOptions): string;
|
|
52
|
+
/**
|
|
53
|
+
* Convert a string to pascal snake case (`Foo_Bar`).
|
|
54
|
+
*/
|
|
55
|
+
export declare function pascalSnakeCase(input: string, options?: CaseOptions): string;
|
|
56
|
+
/**
|
|
57
|
+
* Convert a string to capital case (`Foo Bar`).
|
|
58
|
+
*/
|
|
59
|
+
export declare function capitalCase(input: string, options?: CaseOptions): string;
|
|
60
|
+
/**
|
|
61
|
+
* Convert a string to constant case (`FOO_BAR`).
|
|
62
|
+
*/
|
|
63
|
+
export declare function constantCase(input: string, options?: CaseOptions): string;
|
|
64
|
+
/**
|
|
65
|
+
* Convert a string to dot case (`foo.bar`).
|
|
66
|
+
*/
|
|
67
|
+
export declare function dotCase(input: string, options?: CaseOptions): string;
|
|
68
|
+
/**
|
|
69
|
+
* Convert a string to kebab case (`foo-bar`).
|
|
70
|
+
*/
|
|
71
|
+
export declare function kebabCase(input: string, options?: CaseOptions): string;
|
|
72
|
+
/**
|
|
73
|
+
* Convert a string to path case (`foo/bar`).
|
|
74
|
+
*/
|
|
75
|
+
export declare function pathCase(input: string, options?: CaseOptions): string;
|
|
76
|
+
/**
|
|
77
|
+
* Convert a string to path case (`Foo bar`).
|
|
78
|
+
*/
|
|
79
|
+
export declare function sentenceCase(input: string, options?: CaseOptions): string;
|
|
80
|
+
/**
|
|
81
|
+
* Convert a string to snake case (`foo_bar`).
|
|
82
|
+
*/
|
|
83
|
+
export declare function snakeCase(input: string, options?: CaseOptions): string;
|
|
84
|
+
/**
|
|
85
|
+
* Convert a string to header case (`Foo-Bar`).
|
|
86
|
+
*/
|
|
87
|
+
export declare function trainCase(input: string, options?: CaseOptions): string;
|
|
88
|
+
export * from "./sponge-case";
|
|
89
|
+
export * from "./swap-case";
|
|
90
|
+
export * from "./title-case";
|