ts-object-lite 2.0.18 → 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 +18 -12
  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
@@ -1,6 +1,6 @@
1
1
  # ts-object-lite
2
2
 
3
- [![npm downloads](https://img.shields.io/npm/d18m/ts-object-lite.svg)](https://www.npmjs.com/package/ts-object-lite) [![npm version](https://img.shields.io/npm/v/ts-object-lite.svg)](https://www.npmjs.com/package/ts-object-lite)
3
+ [![npm downloads](https://img.shields.io/npm/dt/ts-object-lite.svg)](https://www.npmjs.com/package/ts-object-lite) [![npm version](https://img.shields.io/npm/v/ts-object-lite.svg)](https://www.npmjs.com/package/ts-object-lite) [![npm license](https://img.shields.io/npm/l/ts-object-lite.svg)](https://www.npmjs.com/package/ts-object-lite) [![npm types](https://img.shields.io/npm/types/ts-object-lite.svg)](https://www.npmjs.com/package/ts-object-lite) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/ts-object-lite.svg)](https://bundlephobia.com/result?p=ts-object-lite)
4
4
 
5
5
  Lightweight, type-safe object utility library for web developers.
6
6
 
@@ -23,10 +23,6 @@ export class MyService {
23
23
  myMethod(): void {
24
24
  this.obj.deepGet({a: {b: 42}}, 'a.b'); // 42
25
25
  this.obj.deepClone({a: 1}); // {a: 1}
26
- this.obj.merge({a: 1}, {b: 2}); // {a: 1, b: 2}
27
- this.obj.omit({a: 1, b: 2}, ['b']); // {a: 1}
28
- this.obj.pick({a: 1, b: 2}, ['a']); // {a: 1}
29
- this.obj.isEmpty({}); // true
30
26
  }
31
27
  }
32
28
  ```
@@ -35,13 +31,23 @@ export class MyService {
35
31
 
36
32
  | Method | Description | Example |
37
33
  |--------|-------------|---------|
38
- | `deepGet` | Get nested value | `{a:{b:42}}, 'a.b'` → `42` |
39
- | `deepClone` | Deep clone object | `{a:1}` → `{a:1}` |
40
- | `merge` | Merge objects | `{a:1}, {b:2}` → `{a:1,b:2}` |
41
- | `omit` | Remove keys | `{a:1,b:2}, ['b']` → `{a:1}` |
42
- | `pick` | Pick keys | `{a:1,b:2}, ['a']` → `{a:1}` |
43
- | `isEmpty` | Check if empty | `{}` → `true` |
34
+ | `deepGet` | Get nested value by path | `{a:{b:42}}, 'a.b'` → `42` |
35
+ | `deepSet` | Set nested value by path | `obj, 'a.b', 42` → `obj.a.b = 42` |
36
+ | `deepClone` | Deep clone object/array | `{a:1}` → `{a:1}` |
37
+ | `clone` | Alias for `deepClone` | `{a:1}` → `{a:1}` |
38
+ | `merge` | Deeply merge multiple objects | `{a:1}, {b:2}` → `{a:1,b:2}` |
39
+ | `omit` | Create object without keys | `{a:1,b:2}, ['b']` → `{a:1}` |
40
+ | `pick` | Create object with only keys | `{a:1,b:2}, ['a']` → `{a:1}` |
41
+ | `isEmpty` | Check if value/object is empty | `{}` → `true` |
42
+ | `isEqual` | Deep equality comparison | `obj1, obj2` → `true/false` |
43
+ | `keys` | Get object keys | `{a:1}` → `['a']` |
44
+ | `values` | Get object values | `{a:1}` → `[1]` |
45
+ | `entries` | Get object [key, value] pairs | `{a:1}` → `[['a', 1]]` |
46
+ | `has` | Check if path exists | `obj, 'a.b'` → `true/false` |
47
+ | `size` | Get number of object properties | `{a:1, b:2}` → `2` |
48
+ | `mapValues` | Map values using callback | `{a:1}, v => v*2` → `{a:2}` |
49
+ | `invert` | Swap keys and values | `{a:'b'}` → `{b:'a'}` |
44
50
 
45
51
  ## License
46
52
 
47
- MIT
53
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-object-lite",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "description": "Lightweight, type-safe object 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",