@theholocron/string-utils 1.0.1 → 1.0.6
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/README.md +11 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@theholocron/string-utils`
|
|
2
2
|
|
|
3
|
-
Convert a string to any case or
|
|
3
|
+
Convert a string to any case or cast between types.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
pnpm add @theholocron/string-utils
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import * as str from "@theholocron/utils
|
|
14
|
+
import * as str from "@theholocron/string-utils";
|
|
15
15
|
|
|
16
16
|
const test = "hello world";
|
|
17
17
|
|
|
18
18
|
// casing
|
|
19
19
|
str.toCamelCase(test); // helloWorld
|
|
20
|
-
str.toConstantCase(test); // HELLO_WORLD
|
|
20
|
+
str.toConstantCase(test); // HELLO_WORLD
|
|
21
21
|
str.toDotCase(test); // hello.world
|
|
22
22
|
str.toKebabCase(test); // hello-world
|
|
23
23
|
str.toLowerCase(test); // hello world
|
|
@@ -29,10 +29,11 @@ str.toTitleCase(test); // Hello World
|
|
|
29
29
|
str.toUpperCase(test); // HELLO WORLD
|
|
30
30
|
|
|
31
31
|
// casting
|
|
32
|
-
str.toArray(test); // ["hello world"]
|
|
33
|
-
str.
|
|
34
|
-
str.toBoolean("
|
|
35
|
-
str.toBoolean(""); // false;
|
|
32
|
+
str.toArray(test); // ["hello world"]
|
|
33
|
+
str.toBoolean("true"); // true
|
|
34
|
+
str.toBoolean(""); // false
|
|
36
35
|
```
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
Check out [The Holocron Archive](https://docs.theholocron.dev/projects/utils/) for more information.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/string-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Convert a string to any case or case to a different data type.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/utils/tree/main/packages/utils-string#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/utils/issues",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"title-case": "^4.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@theholocron/tsdown-config": "^7.
|
|
30
|
-
"@theholocron/vitest-config": "^7.
|
|
29
|
+
"@theholocron/tsdown-config": "^7.6.1",
|
|
30
|
+
"@theholocron/vitest-config": "^7.6.1",
|
|
31
31
|
"@tsconfig/node-lts": "^24.0.0",
|
|
32
32
|
"@vitest/coverage-v8": "^4.1.10",
|
|
33
|
-
"tsdown": "^0.22.
|
|
33
|
+
"tsdown": "^0.22.14",
|
|
34
34
|
"vitest": "^4.1.10"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|