@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/pluralize.d.ts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type PluralizeTest = (word: Word) => boolean;
|
|
5
|
-
export interface Pluralize {
|
|
6
|
-
plural: (word: Word, count?: number, inclusive?: boolean) => Word;
|
|
7
|
-
singular: (word: Word) => Word;
|
|
8
|
-
isPlural: (word: Word) => boolean;
|
|
9
|
-
isSingular: (word: Word) => boolean;
|
|
10
|
-
addPluralRule: (rule: Rule, replacement: Replacement) => void;
|
|
11
|
-
addSingularRule: (rule: Rule, replacement: Replacement) => void;
|
|
12
|
-
addIrregularRule: (single: Word, plural: Word) => void;
|
|
13
|
-
addUncountableRule: (word: Word | RegExp) => void;
|
|
1
|
+
export interface PluralizeOptions {
|
|
2
|
+
count?: number;
|
|
3
|
+
inclusive?: boolean;
|
|
14
4
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
type StringOrRegExp = string | RegExp;
|
|
6
|
+
interface PluralizeFunction {
|
|
7
|
+
(word: string, options?: PluralizeOptions): string;
|
|
8
|
+
plural: (word: string) => string;
|
|
9
|
+
isPlural: (word: string) => boolean;
|
|
10
|
+
singular: (word: string) => string;
|
|
11
|
+
isSingular: (word: string) => boolean;
|
|
12
|
+
addPluralRule: (rule: StringOrRegExp, replacement: string) => void;
|
|
13
|
+
addSingularRule: (rule: StringOrRegExp, replacement: string) => void;
|
|
14
|
+
addUncountableRule: (word: string | RegExp) => void;
|
|
15
|
+
addIrregularRule: (single: string, plural: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const pluralize: PluralizeFunction;
|
|
18
|
+
export declare const singular: PluralizeFunction;
|
|
19
|
+
export declare const plural: PluralizeFunction;
|
|
20
|
+
export default pluralize;
|
package/dist/slug.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SlugifyOptions {
|
|
2
|
+
replacement?: string;
|
|
3
|
+
remove?: RegExp;
|
|
4
|
+
lower?: boolean;
|
|
5
|
+
strict?: boolean;
|
|
6
|
+
locale?: string;
|
|
7
|
+
trim?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type CharMap = Record<string, string>;
|
|
10
|
+
export declare function slugify(string: string, options?: SlugifyOptions): string;
|
|
11
|
+
export declare function extendCharMap(customMap: CharMap): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function spongeCase(input: string, locale?: string[] | string): string;
|
package/dist/string.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function swapCase(input: string, locale?: string[] | string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const WORD_SEPARATORS: Set<string>;
|
|
2
|
+
export declare const SENTENCE_TERMINATORS: Set<string>;
|
|
3
|
+
export declare const TITLE_TERMINATORS: Set<string>;
|
|
4
|
+
export declare const SMALL_WORDS: Set<string>;
|
|
5
|
+
export interface TitleCaseOptions {
|
|
6
|
+
locale?: string | string[];
|
|
7
|
+
sentenceCase?: boolean;
|
|
8
|
+
sentenceTerminators?: Set<string>;
|
|
9
|
+
smallWords?: Set<string>;
|
|
10
|
+
titleTerminators?: Set<string>;
|
|
11
|
+
wordSeparators?: Set<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare function titleCase(input: string, options?: TitleCaseOptions | string[] | string): string;
|
package/dist/utils.d.ts
CHANGED
|
@@ -66,5 +66,6 @@ export declare function random(size?: number, dict?: string): string;
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
export declare function slug(str: string, options?: SlugOptions): string;
|
|
69
|
-
export
|
|
70
|
-
export
|
|
69
|
+
export * from "./detect-indent";
|
|
70
|
+
export * from "./detect-newline";
|
|
71
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/strings",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.67.0",
|
|
5
5
|
"description": "The Stacks string utilities.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -36,17 +36,15 @@
|
|
|
36
36
|
],
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
|
39
|
-
"bun": "./src/index.ts",
|
|
40
39
|
"import": "./dist/index.js"
|
|
41
40
|
},
|
|
42
41
|
"./*": {
|
|
43
|
-
"bun": "./src/*",
|
|
44
42
|
"import": "./dist/*"
|
|
45
43
|
}
|
|
46
44
|
},
|
|
47
45
|
"module": "dist/index.js",
|
|
48
46
|
"types": "dist/index.d.ts",
|
|
49
|
-
"files": ["README.md", "dist"
|
|
47
|
+
"files": ["README.md", "dist"],
|
|
50
48
|
"scripts": {
|
|
51
49
|
"build": "bun build.ts",
|
|
52
50
|
"typecheck": "bun tsc --noEmit",
|
|
@@ -54,21 +52,13 @@
|
|
|
54
52
|
"prepublishOnly": "bun run build"
|
|
55
53
|
},
|
|
56
54
|
"dependencies": {
|
|
57
|
-
"@stacksjs/alias": "0.64.6",
|
|
58
|
-
"@stacksjs/types": "0.64.6",
|
|
59
|
-
"change-case": "^5.4.4",
|
|
60
|
-
"detect-indent": "^7.0.1",
|
|
61
|
-
"detect-newline": "^4.0.1",
|
|
62
55
|
"macroable": "^7.0.2",
|
|
63
|
-
"pluralize": "^8.0.0",
|
|
64
|
-
"slugify": "^1.6.6",
|
|
65
|
-
"string-ts": "^2.2.0",
|
|
66
|
-
"title-case": "^4.3.2",
|
|
67
56
|
"validator": "^13.12.0"
|
|
68
57
|
},
|
|
69
58
|
"devDependencies": {
|
|
70
|
-
"@stacksjs/
|
|
71
|
-
"@
|
|
59
|
+
"@stacksjs/alias": "0.67.0",
|
|
60
|
+
"@stacksjs/development": "0.67.0",
|
|
61
|
+
"@stacksjs/types": "0.67.0",
|
|
72
62
|
"@types/validator": "^13.12.2"
|
|
73
63
|
}
|
|
74
64
|
}
|