@dominik1905/string-toolkit 1.0.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/.idea/modules.xml +8 -0
- package/.idea/string-toolkit.iml +8 -0
- package/.idea/vcs.xml +6 -0
- package/CONTRIBUTING.md +1 -0
- package/FEATURE_REQUEST_TEMPLATE.md +1 -0
- package/ISSUE_TEMPLATE.md +1 -0
- package/LICENSE.md +7 -0
- package/PULL_REQUEST_TEMPLATE.md +1 -0
- package/README.md +26 -0
- package/SECURITY.md +1 -0
- package/index.js +11 -0
- package/index.test.js +5 -0
- package/package.json +15 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/string-toolkit.iml" filepath="$PROJECT_DIR$/.idea/string-toolkit.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
package/.idea/vcs.xml
ADDED
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Contribution Guidelines
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Feature Request Template
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Issue Template
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Pull_Request_Template
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# String Toolkit
|
|
2
|
+
|
|
3
|
+
[cite_start]A small, useful JavaScript library that provides string manipulation functions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
[cite_start]You can install this package using npm or yarn:
|
|
8
|
+
|
|
9
|
+
**npm:**
|
|
10
|
+
npm install @dominik1905/string-toolkit
|
|
11
|
+
|
|
12
|
+
**yarn:**
|
|
13
|
+
yarn add @dominik1905/string-toolkit
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
[cite_start]Here are detailed examples of how to use the available functions.
|
|
18
|
+
|
|
19
|
+
### toSnakeCase
|
|
20
|
+
[cite_start]Converts a string to snake_case (lowercase words separated by underscores)[cite: 9].
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
const { toSnakeCase } = require('@dominik1905/string-toolkit');
|
|
24
|
+
|
|
25
|
+
const result = toSnakeCase("Hello World");
|
|
26
|
+
console.log(result); [cite_start]// Output: "hello_world" [cite: 9, 10]
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Security Policy
|
package/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
function toSnakeCase(str) {
|
|
3
|
+
if (!str) return '';
|
|
4
|
+
// Wandelt alles in Kleinbuchstaben um und ersetzt Leerzeichen durch Unterstriche
|
|
5
|
+
return str.toLowerCase().split(' ').join('_');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Damit die Funktion von anderen Dateien (und unseren Tests) genutzt werden kann:
|
|
9
|
+
module.exports = {
|
|
10
|
+
toSnakeCase
|
|
11
|
+
};
|
package/index.test.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dominik1905/string-toolkit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "jest"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"jest": "^30.3.0"
|
|
14
|
+
}
|
|
15
|
+
}
|