@tspro/ts-utils-lib 1.21.0 → 2.1.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/CHANGELOG.md +17 -0
- package/README.md +70 -1
- package/dist/index.d.mts +278 -876
- package/dist/index.d.ts +278 -876
- package/dist/index.es5.iife.js +1 -0
- package/dist/index.es5.polyfilled.iife.js +1 -0
- package/dist/index.js +1034 -2214
- package/dist/index.mjs +999 -2152
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [2.1.0] - 2025-11-01
|
|
3
|
+
### Added
|
|
4
|
+
- Bundle ``index.es5.iife.js`
|
|
5
|
+
- Bundle `index.es5.polyfilled.iife.js`
|
|
6
|
+
- `AnchoredRect.toString()`
|
|
7
|
+
- `Utils.Str.stringify()`: detect custom `toString()`.
|
|
8
|
+
- `Utils.Str.stringify()`: detect constructor name.
|
|
9
|
+
- `getLibInfo()` (name, version, bundle format).
|
|
10
|
+
|
|
11
|
+
## [2.0.0] - 2025-10-31
|
|
12
|
+
### **Breaking Major Update**
|
|
13
|
+
- Removed all deprecated functions.
|
|
14
|
+
- Removed all deprecated classes.
|
|
15
|
+
- Removed Utils.Is (-> use Guard).
|
|
16
|
+
- Updated Assert, enable usage `let i = Assert.isInteger(i);`.
|
|
17
|
+
- Renamed or updated some Assert and Guard functions.
|
|
18
|
+
- Added new Assert and Guard functions.
|
|
2
19
|
|
|
3
20
|
## [1.21.0] - 2025-10-30
|
|
4
21
|
### Added
|
package/README.md
CHANGED
|
@@ -1,12 +1,81 @@
|
|
|
1
1
|
# TS Utils Lib
|
|
2
2
|
|
|
3
3
|
## About
|
|
4
|
-
A small collection of TypeScript functions, containers, etc. used
|
|
4
|
+
A small collection of TypeScript functions, containers, modules, etc. used
|
|
5
|
+
in my personal projects.
|
|
6
|
+
|
|
7
|
+
I do not use much AI in my work but this is exception. Lot of stuff in this
|
|
8
|
+
lib is written by AI.
|
|
5
9
|
|
|
6
10
|
## Links
|
|
7
11
|
[Repository](https://github.com/pahkasoft/ts-utils-lib) |
|
|
8
12
|
[Package](https://www.npmjs.com/package/@tspro/ts-utils-lib) |
|
|
9
13
|
[Homepage](https://pahkasoft.github.io/ts-utils-lib)
|
|
10
14
|
|
|
15
|
+
Homepage contains TS Docs/API Reference.
|
|
16
|
+
|
|
11
17
|
## Install
|
|
12
18
|
`npm i @tspro/ts-utils-lib`
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
```js
|
|
22
|
+
// Import
|
|
23
|
+
import { UniMap } from "@tspro/ts-utils-lib";
|
|
24
|
+
|
|
25
|
+
// TS example:
|
|
26
|
+
const map = new UniMap<string, number>();
|
|
27
|
+
|
|
28
|
+
// JS example:
|
|
29
|
+
const map = new UniMap();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Browser Usage
|
|
33
|
+
Available in version `2.1.0`.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<!--
|
|
37
|
+
Load this lighter TsUtilsLib version.
|
|
38
|
+
You must load polyfills of your choise first (optional).
|
|
39
|
+
-->
|
|
40
|
+
<script src="https://unpkg.com/@tspro/ts-utils-lib@2.1.0/dist/index.es5.iife.js"></script>
|
|
41
|
+
<script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.1.0/dist/index.es5.iife.js"></script>
|
|
42
|
+
|
|
43
|
+
<!--
|
|
44
|
+
Alternatively you can load this TsUtilsLib version that is bundled with polyfills.
|
|
45
|
+
-->
|
|
46
|
+
<script src="https://unpkg.com/@tspro/ts-utils-lib@2.1.0/dist/index.es5.polyfilled.iife.js"></script>
|
|
47
|
+
<script src="https://cdn.jsdelivr.net/npm/@tspro/ts-utils-lib@2.1.0/dist/index.es5.polyfilled.iife.js"></script>
|
|
48
|
+
|
|
49
|
+
<!-- Another JS example: -->
|
|
50
|
+
<script>
|
|
51
|
+
const { UniMap, Utils } = window.TsUtilsLib;
|
|
52
|
+
const map = new UniMap();
|
|
53
|
+
console.log(Utils.Str.stringify(map));
|
|
54
|
+
</script>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Version 2 Update
|
|
58
|
+
|
|
59
|
+
Made major update because
|
|
60
|
+
- Wanted to remove deprecated renamed or obsoloted stuff.
|
|
61
|
+
- Wanted to upgrade Assert and Guard namespaces.
|
|
62
|
+
- Version 1 had already grown a bit.
|
|
63
|
+
|
|
64
|
+
Deprecations and replacements
|
|
65
|
+
- `Vec2` -> `Vec`
|
|
66
|
+
- `Map1` -> `UniMap`
|
|
67
|
+
- `Map2` -> `BiMap`
|
|
68
|
+
- `Map3` -> `TriMap`
|
|
69
|
+
- `Set1` -> `ValueSet`
|
|
70
|
+
- `DeepSet` -> `ValueSet.createDeep()`
|
|
71
|
+
- `DivRect` -> `AnchoredRect`
|
|
72
|
+
- `Utils.Is.isX...` -> `Guard.isX...`
|
|
73
|
+
|
|
74
|
+
Additions
|
|
75
|
+
- `Rect`
|
|
76
|
+
- `Guard.is*` - intriduced more guards.
|
|
77
|
+
- `Assert.is*` - introduced more assertions.
|
|
78
|
+
- `Utils.Str.stringify(val)` - generic format-anything.
|
|
79
|
+
|
|
80
|
+
There are some other changes (e.g. `Guard.isOddNumber()` -> `Guard.isOdd()`
|
|
81
|
+
and so on), but most the stuff is compatible with 1.x.
|