Skip to content

Commit 0442576

Browse files
committed
2 parents fe9fc36 + 3edab58 commit 0442576

3 files changed

Lines changed: 219 additions & 2 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Code of Conduct
11+
12+
Before creating an issue, please make sure you have read and understood our [Code of Conduct](CODE_OF_CONDUCT.md). We are committed to fostering an inclusive and welcoming community.
13+
14+
## Issue Guidelines
15+
16+
**Search for Existing Issues:**
17+
- Before creating a new issue, please search for existing issues to ensure that the topic hasn't been reported or discussed before.
18+
19+
**Issue Title:**
20+
- Use a clear and descriptive title for your issue.
21+
22+
**Description:**
23+
- Provide a detailed description of the issue, including any relevant information that may help us understand and address it.
24+
25+
**Reproducible Steps:**
26+
- If applicable, provide steps to reproduce the issue. Include any specific configurations or settings that might be relevant.
27+
28+
**Module and Method/Constant:**
29+
- Identify the module and, if applicable, the specific method or constant related to the issue. Follow this format: `Module > Method/Constant`.
30+
31+
**Expected behavior**
32+
A clear and concise description of what you expected to happen.
33+
34+
**Actual Behavior:**
35+
- Describe what actually happened.
36+
37+
**Screenshots**
38+
If applicable, add screenshots to help explain your problem.
39+
40+
**Environment (please complete the following information):**
41+
- Browser Version [e.g. stock browser, safari]
42+
- Node Version [e.g. 20]
43+
- NPM Version [e.g 10]
44+
45+
**Additional context**
46+
Add any other context about the problem here.
47+
48+
## Security Vulnerabilities
49+
50+
If you believe you've found a security vulnerability, please follow these steps:
51+
52+
1. **DO NOT** create a public issue to report the vulnerability. Security vulnerabilities should be reported privately.
53+
54+
2. **Contact Us Privately:**
55+
- Send an email to [security@handyscript.tech](mailto:security@handyscript.tech) with details about the vulnerability. Please include steps to reproduce, potential impact, and any other relevant information.
56+
57+
3. **Wait for Confirmation:**
58+
- We will investigate the issue and respond as soon as possible.
59+
60+
4. **Coordinate Disclosure:**
61+
- Once the security vulnerability is confirmed and addressed, we will work with you to coordinate a responsible disclosure plan.
62+
63+
Thank you for contributing to Handy Script and helping to improve our npm package! 🚀
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for handyscript
4+
title: "[FEATREQ]"
5+
labels: ''
6+
assignees: vvhybe
7+
8+
---
9+
10+
# Feature Request Template
11+
12+
## Code of Conduct
13+
14+
Before creating a feature request, please make sure you have read and understood our [Code of Conduct](CODE_OF_CONDUCT.md). We are committed to fostering an inclusive and welcoming community.
15+
16+
## Feature Request Guidelines
17+
18+
1. **Search for Existing Feature Requests:**
19+
- Before creating a new feature request, please search for existing requests to ensure that the feature hasn't been requested or discussed before.
20+
21+
2. **Request Title:**
22+
- Use a clear and descriptive title for your feature request.
23+
24+
3. **Description:**
25+
- Provide a detailed description of the feature you are requesting. Explain why you believe it would be beneficial and how it would enhance the functionality of the npm package.
26+
27+
4. **Use Case:**
28+
- Describe a use case or scenario where the proposed feature would be particularly useful.
29+
30+
5. **Alternatives Considered:**
31+
- Have you considered any alternative solutions or workarounds? If so, please describe them.
32+
33+
6. **Module and Method/Constant (if applicable):**
34+
- If your feature request is related to a specific module, method, or constant, please specify using the format: `Module > Method/Constant`.
35+
36+
7. **Additional Context:**
37+
- Provide any additional context, screenshots, or examples that might help us better understand your feature request.
38+
39+
8. **Environment:**
40+
- Specify your environment, including the version of your npm package, Node.js version, and any other relevant details.
41+
42+
## Code Samples
43+
44+
If applicable, provide code samples or examples that illustrate how the new feature could be used. This can help us better understand your vision for the enhancement.
45+
46+
Thank you for contributing to Handy Script and helping us improve! 🌟

‎static/documentation/number.md‎

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,118 @@
22

33
The `Number` module extends the `Number` object for more functionality and ease of use. when dealing with Number objects in JavaScript.
44

5-
**© HandyScript Number 6/16/23 - Last Update: 9/25/23:**
5+
**© HandyScript Number 6/16/23 - Last Update: 11/22/23:**
66

77
## Table of Contents
88

9+
- [Handy Script Number](#handy-script-number)
10+
- [Table of Contents](#table-of-contents)
11+
- [Utility Methods](#utility-methods)
12+
- [toHuman()](#tohuman)
13+
- [toReadable(separator?)](#toreadableseparator)
14+
- [toWords()](#towords)
15+
- [isFinite()](#isfinite)
16+
- [isSafeNumber()](#issafenumber)
17+
18+
## Utility Methods
19+
20+
### toHuman
21+
22+
The `toHuman` method returns a string representation of a number in a human-readable format. It formats numbers using abbreviations such as K (thousand), M (million), B (billion), T (trillion), etc.
23+
24+
```typescript
25+
Number.prototype.toHuman(): string
26+
```
27+
28+
**Returns:** `string` - The Representation of a number in a human-readable format.
29+
30+
**Example:**
31+
32+
```javascript
33+
(999).toHuman(); // Returns "999"
34+
(1000).toHuman(); // Returns "1K"
35+
(1500000000).toHuman(); // Returns "1.5B"
36+
```
37+
38+
### toReadable
39+
40+
The `toReadable` method returns a string representation of a number in a readable format. It adds separators to the number, making it easier to read. The default separator is `-`, but you can specify a custom separator.
41+
42+
```typescript
43+
Number.prototype.toReadable (separator = "-"): string
44+
```
45+
46+
**Parameters:**
47+
48+
- `separator` - The separator to be used. (Optional), defaults to `-`.
49+
50+
**Returns:** `string` - Representation of a number in a readable format.
51+
52+
**Example:**
53+
54+
```javascript
55+
(999).toReadable(); // Returns "999"
56+
(1000).toReadable(); // Returns "1-000"
57+
(1500000000).toReadable("_"); // Returns "1_500_000_000"
58+
```
59+
60+
### toWords
61+
62+
The `toWords` method converts an integer into words. It provides a textual representation of the number in English words.
63+
64+
```typescript
65+
Number.prototype.toWords(): string
66+
```
67+
68+
**Returns:** `string` - the textual representation of the number in English words.
69+
70+
**Error Handling:**
71+
72+
- Throws a `TypeError` for non-finite numbers.
73+
- Throws a `RangeError` for numbers outside the safe range.
74+
75+
**Example:**
76+
77+
```javascript
78+
(0).toWords(); // Returns "zero"
79+
(22).toWords(); // Returns "twenty-two"
80+
(8888).toWords(); // Returns "eight thousand, eight hundred eighty-eight"
81+
```
82+
83+
### isFinite:
84+
85+
The `isFinite` method checks if a number is finite.
86+
87+
```typescript
88+
Number.prototype.isFinite(): boolean
89+
```
90+
91+
**Returns:** `boolean` - Is finite number
92+
93+
**Example:**
94+
95+
```javascript
96+
(10).isFinite(); // Returns true
97+
Infinity.isFinite(); // Returns false
98+
```
99+
100+
### isSafeNumber
101+
102+
The `isSafeNumber` method checks if a number is within the safe integer range.
103+
104+
```typescript
105+
Number.prototype.isSafeNumber(): boolean
106+
```
107+
108+
**Returns:** `boolean` - Is the number within the safe integer range.
109+
110+
**Example:**
111+
112+
```javascript
113+
(10).isSafeNumber(); // Returns true
114+
(Number.MAX_SAFE_INTEGER + 1).isSafeNumber(); // Returns false
115+
```
116+
9117
<p align="center"><b>© HandyScript Number 6/16/23</b></p>
10118

11-
This Markdown documentation is detailed and extensive to use the `Number` module to its full potential, along with their descriptions and TypeScript function signatures. The table of contents at the beginning [Back To Top](#table-of-contents) of the document allows for easy navigation. If you have any questions or suggestions, please contact us at <vvhybe@hotmail.com>.
119+
This documentation provides a comprehensive guide to the Number module in HandyScript. The module extends the native JavaScript Number object, offering additional functionality and ease of use when dealing with numbers. The table of contents at the beginning [Back To Top](#table-of-contents) of the document allows for easy navigation. If you have any questions or suggestions, please contact us at <vvhybe@hotmail.com>.

0 commit comments

Comments
 (0)