Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
number-helper-functions
Advanced tools
Kind: global class
boolean
boolean
boolean
boolean
boolean
boolean
boolean
number
string
number
number
NumberHelper Class
boolean
Checks if element is a number
Kind: static method of NumberHelper
Returns: boolean
- Whether the element is a number or not
Param | Type | Description |
---|---|---|
n | string | number | The element to check |
boolean
Checks if element is an integer
Kind: static method of NumberHelper
Returns: boolean
- Whether the number is an integer or not
Param | Type | Description |
---|---|---|
n | string | number | Number to check |
boolean
Checks if element is a float number
Kind: static method of NumberHelper
Returns: boolean
- Whether the number is a float or not
Param | Type | Description |
---|---|---|
n | string | number | Number to check |
boolean
Checks if number is even
Kind: static method of NumberHelper
Returns: boolean
- Whether the number is even or not
Param | Type | Description |
---|---|---|
n | number | Number to check |
boolean
Checks if number is odd
Kind: static method of NumberHelper
Returns: boolean
- Whether the number is odd or not
Param | Type | Description |
---|---|---|
n | number | Number to check |
boolean
Checks if numer is finite
Kind: static method of NumberHelper
Returns: boolean
- Whether the number is finite or not
Param | Type | Description |
---|---|---|
n | number | Number to check |
boolean
Checks if number is prime
Kind: static method of NumberHelper
Returns: boolean
- Whether the numbere is prime or not
Param | Type | Description |
---|---|---|
num | number | Number to check |
number
Gets random integer number in a range
Kind: static method of NumberHelper
Returns: number
- Random number in range
Param | Type | Description |
---|---|---|
min | number | Minimum number |
max | number | Maximum number |
string
Prefixes a number with zeros until desired length
Kind: static method of NumberHelper
Returns: string
- Padded number as a string
Param | Type | Description |
---|---|---|
number | number | Number to pad |
length | number | Desired number length |
number
Converts string to number
Kind: static method of NumberHelper
Returns: number
- Converted number
Param | Type | Default | Description |
---|---|---|---|
toCheck | string | number | Number-like to convert | |
[decimals] | number | 2 | Number of decimals to truncate |
number
Processes number to get clean value
Kind: static method of NumberHelper
Returns: number
- Parsed and processed number
Param | Type | Default | Description |
---|---|---|---|
value | string | number | String or number to process | |
[decimals] | number | 2 | No. of decimals to truncate to |
FAQs
Helper with multiple number-related methods
We found that number-helper-functions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.