Skip to content

Commit b89d950

Browse files
authored
Merge pull request #258 from ryoppippi/feature/257
feat: Update docstrings in various files
2 parents ed3434d + 1b353d8 commit b89d950

File tree

7 files changed

+61
-53
lines changed

7 files changed

+61
-53
lines changed

deno.lock

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

import_map.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"imports": {
3+
"@ryoppippi/str-fns": "./src/index.ts",
34
"type-fest": "npm:type-fest@4.15.0",
45
"assert": "jsr:@std/assert@0.222.1",
56
"type-testing": "jsr:@std/testing@0.222.1/types",

src/capitalize.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ type CapitalizedString<T extends Readonly<string>> = IsStringLiteral<T> extends
44
true ? Capitalize<T> : string;
55

66
/**
7-
* @description capitalize first letter of string
7+
* capitalize first letter of string
88
*
9-
* @param input - input string to capitalize. type should be matched to T
10-
*
11-
* @example
12-
* capitalize('a') // returns 'A'
9+
* ```ts
10+
* import { capitalize } from '@ryoppippi/str-fns'
11+
* const _: 'A' = capitalize('a');
12+
* const __: 'Abc' = capitalize('abc');
13+
* const ___: '' = capitalize('');
14+
* ```
1315
*
14-
* @example
15-
* capitalize('abc') // returns 'Abc'
16-
*
17-
* @example
18-
* capitalize('') // returns ''
16+
* @param input - input string to capitalize. type should be matched to T
1917
*/
2018
export function capitalize<T extends Readonly<string>>(
2119
input: T,

src/lowercase.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ type LowercaseString<T extends Readonly<string>> = IsStringLiteral<T> extends
44
true ? Lowercase<T> : string;
55

66
/**
7-
* @description get lowercase string
7+
* get lowercase string
88
*
9+
* ```ts
10+
* import { lowercase } from '@ryoppippi/str-fns'
11+
* const _: 'a' = lowercase('A');
12+
* const __: 'abc' = lowercase('aBC');
13+
* const ___: '' = lowercase('');
14+
* ```
915
* @param input - input string to capitalize. type should be matched to T
10-
*
11-
* @example
12-
* lowercase('A') // 'a'
13-
*
14-
* @example
15-
* lowercase('aBC') // 'abc'
16-
*
17-
* @example
18-
* lowercase('') // ''
1916
*/
2017
export function lowercase<T extends Readonly<string>>(
2118
input: T,

src/split.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,19 @@ type SplitString<
77
: Readonly<string[]>;
88

99
/**
10-
* @description Split string by separator
10+
* Split string by separator
11+
*
12+
* ```ts
13+
* import { split } from '@ryoppippi/str-fns'
14+
* const _: readonly ['A', 'c'] = split('Abc', 'b');
15+
* const __: readonly ['a', 'b', 'c'] = split('a-b-c', '-');
16+
* const ___: readonly ['a', '-', 'b', '-', 'c'] = split('a-b-c', '');
17+
* const ____: readonly ['a-b-c'] = split('a-b-c', '$');
18+
* ```
1119
*
1220
* @param input - string to split. type should be matched to T
1321
*
1422
* @param separator - separator to split string. type should be matched to U
15-
*
16-
* @example
17-
* split('Abc', 'b') // returns ['A', 'c']
18-
*
19-
* @example
20-
* split('a-b-c', '-') // returns ['a', 'b', 'c']
21-
*
22-
* @example
23-
* split('a-b-c', '') // returns ['a', '-', 'b', '-', 'c']
24-
*
25-
* @example
26-
* split('a-b-c', '$') // returns ['a-b-c']
2723
*/
2824
export function split<T extends Readonly<string>, U extends Readonly<string>>(
2925
input: T,

src/uncapitalize.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ type UncapitalizedString<T extends Readonly<string>> =
44
IsStringLiteral<T> extends true ? Uncapitalize<T> : string;
55

66
/**
7-
* @description uncapitalize first letter of string
7+
* uncapitalize first letter of string
88
*
9-
* @param input - input string to capitalize. type should be matched to T
10-
*
11-
* @example
12-
* uncapitalize('A') // returns 'a'
9+
* ```ts
10+
* import { uncapitalize } from '@ryoppippi/str-fns'
11+
* const _: 'a' = uncapitalize('A');
12+
* const __: 'abc' = uncapitalize('Abc');
13+
* const ___: '' = uncapitalize('');
14+
* ```
1315
*
14-
* @example
15-
* uncapitalize('Abc') // returns 'abc'
16-
*
17-
* @example
18-
* uncapitalize('') // returns ''
16+
* @param input - input string to capitalize. type should be matched to T
1917
*/
2018
export function uncapitalize<T extends Readonly<string>>(
2119
input: T,

src/uppercase.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ type UppercaseString<T extends Readonly<string>> = IsStringLiteral<T> extends
66
/**
77
* @description get uppercase string
88
*
9-
* @param input - input string to capitalize. type should be matched to T
10-
*
11-
* @example
12-
* uppercase('a') // 'A'
9+
* ```ts
10+
* import { uppercase } from '@ryoppippi/str-fns'
11+
* const _: 'A' = uppercase('a');
12+
* const __: 'ABC' = uppercase('abc');
13+
* const ___: '' = uppercase('');
14+
* ```
1315
*
14-
* @example
15-
* uppercase('abc') // 'Abc'
16-
*
17-
* @example
18-
* uppercase('') // ''
16+
* @param input - input string to capitalize. type should be matched to T
1917
*/
2018
export function uppercase<T extends Readonly<string>>(
2119
input: T,

0 commit comments

Comments
 (0)