ts-string-lite 2.0.19 → 2.0.20

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -10
  3. package/package.json +5 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gaurang Mody
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -22,13 +22,7 @@ export class MyService {
22
22
 
23
23
  myMethod(): void {
24
24
  this.str.slugify('Hello World'); // 'hello-world'
25
- this.str.camelCase('hello world'); // 'helloWorld'
26
- this.str.kebabCase('HelloWorld'); // 'hello-world'
27
- this.str.pascalCase('hello world'); // 'HelloWorld'
28
- this.str.truncate('Hello World', 10); // 'Hello W...'
29
- this.str.capitalize('hello'); // 'Hello'
30
- this.str.titleCase('hello world'); // 'Hello World'
31
- this.str.escapeHtml('<script>'); // '&lt;script&gt;'
25
+ this.str.levenshtein('kitten', 'sitting'); // 3
32
26
  }
33
27
  }
34
28
  ```
@@ -40,14 +34,24 @@ export class MyService {
40
34
  | `slugify` | Convert string to URL-friendly slug | `'Hello World'` → `'hello-world'` |
41
35
  | `camelCase` | Convert to camelCase | `'hello world'` → `'helloWorld'` |
42
36
  | `kebabCase` | Convert to kebab-case | `'HelloWorld'` → `'hello-world'` |
37
+ | `snakeCase` | Convert to snake_case | `'HelloWorld'` → `'hello_world'` |
43
38
  | `pascalCase` | Convert to PascalCase | `'hello world'` → `'HelloWorld'` |
39
+ | `titleCase` | Convert to Title Case | `'hello world'` → `'Hello World'` |
44
40
  | `truncate` | Truncate string to length | `'Hello World', 10` → `'Hello W...'` |
45
41
  | `capitalize` | Capitalize first letter | `'hello'` → `'Hello'` |
46
- | `titleCase` | Convert to Title Case | `'hello world'` → `'Hello World'` |
47
42
  | `escapeHtml` | Escape HTML characters | `'<script>'` → `'&lt;script&gt;'` |
43
+ | `unescapeHtml` | Unescape HTML characters | `'&lt;script&gt;'` → `'<script>'` |
44
+ | `repeat` | Repeat string N times | `'a', 3` → `'aaa'` |
45
+ | `reverse` | Reverse string | `'abc'` → `'cba'` |
46
+ | `base64Encode`| Encode string to Base64 | `'hello'` → `'aGVsbG8='` |
47
+ | `base64Decode`| Decode string from Base64 | `'aGVsbG8='` → `'hello'` |
48
+ | `randomString`| Generate random string | `10` → `'aB3kL9... '` |
49
+ | `trimStart` | Trim specified chars from start | `'--abc', '-'` → `'abc'` |
50
+ | `trimEnd` | Trim specified chars from end | `'abc--', '-'` → `'abc'` |
51
+ | `words` | Split string into words | `'hello world'` → `['hello', 'world']` |
52
+ | `countWords` | Count words in string | `'hello world'` → `2` |
53
+ | `levenshtein` | Calculate edit distance | `'kitten', 'sitting'` → `3` |
48
54
 
49
55
  ## License
50
56
 
51
57
  MIT
52
-
53
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-string-lite",
3
- "version": "2.0.19",
3
+ "version": "2.0.20",
4
4
  "description": "Lightweight, type-safe string utility library for web developers",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -13,7 +13,9 @@
13
13
  }
14
14
  },
15
15
  "files": [
16
- "dist"
16
+ "dist",
17
+ "LICENSE",
18
+ "README.md"
17
19
  ],
18
20
  "scripts": {
19
21
  "build": "tsc -p tsconfig.json"
@@ -25,7 +27,7 @@
25
27
  "helpers",
26
28
  "lite"
27
29
  ],
28
- "author": "Gaurang Mody - G8X",
30
+ "author": "Gaurang Mody",
29
31
  "license": "MIT",
30
32
  "repository": {
31
33
  "type": "git",