@axi-engine/utils 0.1.0 → 0.1.2
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/README.md +42 -0
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @axi-engine/utils
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@axi-engine/utils)
|
|
4
|
+
|
|
5
|
+
Core utility library for Axi Engine.
|
|
6
|
+
|
|
7
|
+
Provides a set of common, standalone functions for arrays, math, type guards, random generation, and more.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @axi-engine/utils
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Here are a few examples of how to use the utilities from this package:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { randInt, clampNumber, haveSameElements } from '@axi-engine/utils';
|
|
21
|
+
|
|
22
|
+
// Get a random integer
|
|
23
|
+
const diceRoll = randInt(1, 7); // Returns a number between 1 and 6
|
|
24
|
+
|
|
25
|
+
// Clamp a value
|
|
26
|
+
const health = clampNumber(120, 0, 100); // Returns 100
|
|
27
|
+
|
|
28
|
+
// Compare arrays without order
|
|
29
|
+
const isSame = haveSameElements(['a', 'b'], ['b', 'a']); // Returns true
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
API Reference
|
|
34
|
+
|
|
35
|
+
Will be available when code and repository will be fully published
|
|
36
|
+
|
|
37
|
+
<!--
|
|
38
|
+
[**Full API Documentation**](https://github.com/.../blob/main/packages/utils/docs/api/README.md)
|
|
39
|
+
-->
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axi-engine/utils",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Core utility library for Axi Engine, providing common functions for arrays, math, type guards, and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
17
|
+
"docs": "typedoc src/index.ts --out docs/api --options ../../typedoc.json",
|
|
17
18
|
"test": "echo 'No tests yet for @axi-engine/utils'"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|