@hichchi/utils 0.0.3 โ 0.0.5
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 +35 -0
- package/README.md +8274 -0
- package/package.json +1 -1
- package/readme-top.md +190 -0
package/package.json
CHANGED
package/readme-top.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
<!--suppress ALL -->
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
# ๐ ๏ธ @hichchi/utils
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
|
|
9
|
+
**A comprehensive utility library with essential helper functions for JavaScript/TypeScript applications**
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@hichchi/utils)
|
|
12
|
+
[](https://www.npmjs.com/package/@hichchi/utils)
|
|
13
|
+
[](https://github.com/hichchidev/hichchi/blob/main/LICENSE)
|
|
14
|
+
[](https://www.typescriptlang.org/)
|
|
15
|
+
|
|
16
|
+
*Part of the [Hichchi](https://github.com/hichchidev/hichchi) ecosystem - A powerful, scalable application built with Nx workspace*
|
|
17
|
+
|
|
18
|
+
[๐ Jump to Documentation](#-api-documentation)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ๐ Table Of Contents
|
|
25
|
+
|
|
26
|
+
- [๐ฆ Installation](#-installation)
|
|
27
|
+
- [โก Quick Start](#-quick-start)
|
|
28
|
+
- [๐ Prerequisites](#-prerequisites)
|
|
29
|
+
- [๐ Overview](#-overview)
|
|
30
|
+
- [โจ Features](#-features)
|
|
31
|
+
- [๐ ๏ธ Troubleshooting](#๏ธ-troubleshooting)
|
|
32
|
+
- [๐ง Development](#-development)
|
|
33
|
+
- [๐ API Documentation](#-api-documentation)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ๐ฆ Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @hichchi/utils
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## โก Quick Start
|
|
44
|
+
|
|
45
|
+
Get up and running with powerful utility functions in just a few minutes:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// 1. Install the package
|
|
49
|
+
npm install @hichchi/utils
|
|
50
|
+
|
|
51
|
+
// 2. Import utility functions
|
|
52
|
+
import { dottedPathObjectToNested } from '@hichchi/utils';
|
|
53
|
+
|
|
54
|
+
// 3. Use utility functions in your application
|
|
55
|
+
const nestedObject = dottedPathObjectToNested({
|
|
56
|
+
"id": 123,
|
|
57
|
+
"name": "John Doe",
|
|
58
|
+
"profile.age": 30,
|
|
59
|
+
"profile.address.city": "New York",
|
|
60
|
+
"profile.address.zip": "10001"
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
Result:
|
|
64
|
+
// {
|
|
65
|
+
// id: 123,
|
|
66
|
+
// name: "John Doe",
|
|
67
|
+
// profile: {
|
|
68
|
+
// age: 30,
|
|
69
|
+
// address: {
|
|
70
|
+
// city: "New York",
|
|
71
|
+
// zip: "10001"
|
|
72
|
+
// }
|
|
73
|
+
// }
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## ๐ Prerequisites
|
|
79
|
+
|
|
80
|
+
Before installing @hichchi/utils, ensure you have:
|
|
81
|
+
|
|
82
|
+
### Required Dependencies
|
|
83
|
+
- **Node.js**: ^18.0.0
|
|
84
|
+
- **TypeScript**: ^5.0.0 (for TypeScript projects)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## ๐ Overview
|
|
88
|
+
|
|
89
|
+
๐ฏ **Your essential toolkit** for JavaScript and TypeScript development. From string manipulation to file operations, from object utilities to URL handling - everything you need to streamline your development workflow with battle-tested, performance-optimized utility functions.
|
|
90
|
+
|
|
91
|
+
## โจ Features
|
|
92
|
+
|
|
93
|
+
### ๐ค String Utilities
|
|
94
|
+
- ๐จ **Case Conversion** - camelCase, PascalCase, snake_case, kebab-case transformations
|
|
95
|
+
- ๐ **String Analysis** - Pattern matching, validation, and content analysis
|
|
96
|
+
- โ๏ธ **String Manipulation** - Truncation, padding, cleaning, and formatting
|
|
97
|
+
- ๐ท๏ธ **Slug Generation** - URL-friendly string generation with customizable options
|
|
98
|
+
- ๐ **Template Processing** - Advanced string templating with variable substitution
|
|
99
|
+
|
|
100
|
+
### ๐๏ธ Object Utilities
|
|
101
|
+
- ๐ **Deep Operations** - Deep merge, clone, compare, and transformation
|
|
102
|
+
- ๐ฏ **Property Access** - Safe property getting/setting with dot notation
|
|
103
|
+
- ๐ **Object Analysis** - Type checking, validation, and structure analysis
|
|
104
|
+
- ๐ **Data Transformation** - Object flattening, nesting, and restructuring
|
|
105
|
+
- ๐งน **Object Cleaning** - Remove null/undefined values, empty objects
|
|
106
|
+
|
|
107
|
+
### ๐ String Template Utilities
|
|
108
|
+
- ๐จ **Template Processing** - Advanced string templating with variable substitution
|
|
109
|
+
- ๐ **Dynamic Content** - Apply templates with custom prefixes and transformations
|
|
110
|
+
- ๐ท๏ธ **Tag-based Processing** - Support for various template tags and formats
|
|
111
|
+
|
|
112
|
+
### ๐ URL Utilities
|
|
113
|
+
- ๐ **Redirect Validation** - Secure redirect URL validation against allowed domains
|
|
114
|
+
- ๐ก๏ธ **Security Features** - Prevent open redirect vulnerabilities
|
|
115
|
+
|
|
116
|
+
### โ
Assertion Utilities
|
|
117
|
+
- ๐ **Type Guards** - TypeScript type guards for arrays and objects
|
|
118
|
+
- ๐ฏ **Property Checking** - Check if objects have specific properties
|
|
119
|
+
- ๐ก๏ธ **Safe Type Narrowing** - Runtime type validation with TypeScript support
|
|
120
|
+
|
|
121
|
+
### ๐จ Developer Experience
|
|
122
|
+
- ๐ **Full TypeScript Support** - Complete type definitions and IntelliSense
|
|
123
|
+
- ๐ง **Tree Shaking** - Import only what you need for optimal bundle size
|
|
124
|
+
- ๐ **Comprehensive Documentation** - Detailed JSDoc comments for all functions
|
|
125
|
+
- ๐งช **Well Tested** - Extensive test coverage for reliability
|
|
126
|
+
- ๐ **Performance Optimized** - Efficient algorithms and minimal overhead
|
|
127
|
+
|
|
128
|
+
## ๐ Security Best Practices
|
|
129
|
+
|
|
130
|
+
Detailed security best practices will be added here
|
|
131
|
+
|
|
132
|
+
## ๐ ๏ธ Troubleshooting
|
|
133
|
+
|
|
134
|
+
### Common Issues
|
|
135
|
+
|
|
136
|
+
#### TypeScript Compilation Issues
|
|
137
|
+
```bash
|
|
138
|
+
# Ensure you have the correct TypeScript version
|
|
139
|
+
npm install typescript@^5.0.0 --save-dev
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## ๐ง Development
|
|
143
|
+
|
|
144
|
+
### Building the Library
|
|
145
|
+
```bash
|
|
146
|
+
nx build utils
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Running Tests
|
|
150
|
+
```bash
|
|
151
|
+
nx test utils
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Linting
|
|
155
|
+
```bash
|
|
156
|
+
nx lint utils
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Performance Testing
|
|
160
|
+
```bash
|
|
161
|
+
nx run utils:benchmark
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
<div align="center">
|
|
167
|
+
|
|
168
|
+
**Made with โค๏ธ by [Hichchi Dev](https://github.com/hichchidev)**
|
|
169
|
+
|
|
170
|
+
[](https://github.com/hichchidev/hichchi)
|
|
171
|
+
[](https://github.com/hichchidev/hichchi/issues)
|
|
172
|
+
[](https://github.com/hichchidev/hichchi/issues)
|
|
173
|
+
|
|
174
|
+
*Building the future of development utilities, one commit at a time*
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
# ๐ API Documentation
|
|
181
|
+
|
|
182
|
+
Complete technical reference for all classes, interfaces, methods, and types in this library.
|
|
183
|
+
|
|
184
|
+
**Auto-generated by TypeDoc** - Browse through detailed API references, code examples, and implementation guides below.
|
|
185
|
+
|
|
186
|
+
<!-- TypeDoc generated documentation will be appended below this point -->
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## ๐ API Table of Contents
|