@tspro/ts-utils-lib
v2.3.0
Published
Useful library of typescript classes, modules and functions.
Downloads
335
Readme
TS Utils Lib
About
A small collection of TypeScript functions, containers, modules, etc. used in my personal projects.
I do not use much AI in my work but this is exception. Lot of stuff in this lib is written by AI.
Links
Repository | Package | Homepage
Homepage contains TS Docs/API Reference.
Install
npm i @tspro/ts-utils-lib
Usage
// Import
import { UniMap } from "@tspro/ts-utils-lib";
// TS example:
const map = new UniMap<string, number>();
// JS example:
const map = new UniMap();Browser Usage
- Available in version
2.1.0. - These bundles are transpiled with
ES5target. - With non-polyfilled versions you can use option to your own polyfilling choise.
<!-- Load non-polyfilled or polyfilled bundles on unpkg cdn -->
<script src="https://unpkg.com/@tspro/[email protected]/dist/index.es5.iife.js"></script>
<script src="https://unpkg.com/@tspro/[email protected]/dist/index.es5.polyfilled.iife.js"></script>
<!-- Load non-polyfilled or polyfilled bundles on jsdelivr cdn -->
<script src="https://cdn.jsdelivr.net/npm/@tspro/[email protected]/dist/index.es5.iife.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tspro/[email protected]/dist/index.es5.polyfilled.iife.js"></script>
<!-- JS example: -->
<script>
const { UniMap, Utils } = window.TsUtilsLib;
const map = new UniMap();
console.log(Utils.Str.stringify(map));
</script>Version 2 Update
Made major update because
- Wanted to remove deprecated renamed or obsoloted stuff.
- Wanted to upgrade Assert and Guard namespaces.
- Version 1 had already grown a bit.
Deprecations and replacements
Vec2->VecMap1->UniMapMap2->BiMapMap3->TriMapSet1->ValueSetDeepSet->ValueSet.createDeep()DivRect->AnchoredRectUtils.Is.isX...->Guard.isX...
Additions
RectGuard.is*- intriduced more guards.Assert.is*- introduced more assertions.Utils.Str.stringify(val)- generic format-anything.
There are some other changes (e.g. Guard.isOddNumber() -> Guard.isOdd()
and so on), but most the stuff is compatible with 1.x.
