@vyacheslav97/ct
Advanced tools
Comparing version 0.0.14 to 0.0.15
{ | ||
"type": "module", | ||
"name": "@vyacheslav97/ct", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "", | ||
@@ -15,3 +15,10 @@ "keywords": [ | ||
"binary search", | ||
"duplicates search" | ||
"duplicates search", | ||
"standard regexp", | ||
"isNumber", | ||
"number validators", | ||
"exponential format", | ||
"exponential", | ||
"decimal regexp", | ||
"decimal" | ||
], | ||
@@ -54,2 +61,10 @@ "exports": { | ||
"tyoes": "./dist/implementations/algorithms/duplicatesSearcher.d.ts" | ||
}, | ||
"./isNumber": { | ||
"import": "./dist/implementations/NumberValidators/isNumber.js", | ||
"types": "./dist/implementations/NumberValidators/isNumber.d.ts" | ||
}, | ||
"./numbersRegExps": { | ||
"import": "./dist/implementations/NumberValidators/NumberRegExps.js", | ||
"types": "./dist/implementations/NumberValidators/NumberRegExps.d.ts" | ||
} | ||
@@ -56,0 +71,0 @@ }, |
112
README.md
@@ -7,16 +7,25 @@ # <u>Common tools (ct, also @vyacheslav97/ct)</u> | ||
Current version renewals: | ||
Current version renewals (0.0.15): | ||
- [MutationsHistory abstract class](#mutationsHistory) | ||
- [Binary search procedure template](#binarySearch) | ||
- [Duplicates search procedure template](#duplicatesSearch) | ||
- [**isNumber** data validator](#isNumber) | ||
- [Decimal integers regular expressions](#integerRegExp): signed, unsigned, negative integers of arbitrary length | ||
- [Decimal floating point numbers expressions](#floatRegExp): signed, unsigned, negative floats of arbitrary length | ||
- [Decimal numbers of exponential format](#expRegExp) | ||
Next scheduled updates: | ||
Next scheduled **major** updates: | ||
- Numbers validation methods: various standard regexp, **isNumber** | ||
- **Table** class template | ||
- Default pathfinder template based on BFS algorithm | ||
- Default leveling step function based on DFS algorithm | ||
Next scheduled **minor** updates: | ||
- **clear** method for **Graph** template class | ||
- Input nodes validation within **Graph** and **Tree** constructors | ||
- **isLeaf** boolean flag for **Tree** nodes, and related logic of its auto handling during adding and removing nodes | ||
## Prerequisites | ||
@@ -34,2 +43,6 @@ | ||
- [Duplicates search procedure template](#duplicatesSearch) | ||
- [isNumber](#isNumber) | ||
- [Decimal integer RegExp](#integerRegExp) | ||
- [Decimal float RegExp](#floatRegExp) | ||
- [Exponential format number RegExp](#expRegExp) | ||
@@ -574,1 +587,88 @@ <a id="uic"></a> | ||
<a id="isNumber"></a> | ||
## isNumber | ||
**isNumber** validator import: | ||
```ts | ||
import isNumber from '@vyacheslav97/ct/isNumber'; | ||
``` | ||
**isNumber** represents a simple method to check whether its argument actually **number** or not. It based on two consequent test: | ||
- Ensures, that **typeof** input argument is **number** | ||
- Examines result of **Number.isNaN** call on input argument | ||
<a id="integerRegExp"></a> | ||
## Decimal integer RegExp | ||
Regular expressions for decimal integers testing import: | ||
```ts | ||
import { | ||
integerNumberRegex, | ||
unsignedIntegerNumberRegex, | ||
negativeIntegerNumberRegex, | ||
} from '@vyacheslav97/ct/numbersRegExps'; | ||
``` | ||
All expressions are aimed to detangle whether a whole given string is an integer or not. | ||
Particularly: | ||
- **integerNumberRegex** checks, whether an input string has signed or unsigned integer number: string optionally starts with a single **+** or **-**, followed by digits sequence, which starts with any digits except **0**, or single usingned **0** | ||
- **unsignedIntegerNumberRegex** almost copies **integerNumberRegex**, but start signs are not allowed | ||
- **negativeIntegerNumberRegex** almost copies **integerNumberRegex**, but start sign must be **-** | ||
<a id="floatRegExp"></a> | ||
## Decimal float RegExp | ||
Regular expressions for decimal floats testing import: | ||
```ts | ||
import { | ||
floatNumberRegex, | ||
unsignedFloatNumberRegex, | ||
negativeFloatingPointNumberRegex, | ||
} from '@vyacheslav97/ct/numbersRegExps'; | ||
``` | ||
All expressions are aimed to detangle whether a whole given string is a float number or not. | ||
Particularly: | ||
- **floatNumberRegex** checks, whether an input string has signed or unsigned float number: string optionally starts with a single **+** or **-**, followed by digits sequence, which first digit can't be **0**, or single **0** with no sign. All this stuff is accompanied with optional single dot and that dot has optional digits sequence. So, following numbers are correct: **0**, **0.**, **0.241253**, **-1.24**, **3**, **-5**, **+12** . | ||
- **unsignedFloatNumberRegex** resembles **floatNumberRegex**, but denies starting sign, positive or negative | ||
- **negativeFloatingPointNumberRegex** mimics **floatNumberRegex**, but requires **-** as a starting sign | ||
<a id="expRegExp"></a> | ||
## Exponential format number RegExp | ||
Regular expression for number of exponential format testing import: | ||
```ts | ||
import { | ||
exponentialNumberFormatRegex, | ||
} from '@vyacheslav97/ct/numbersRegExps'; | ||
``` | ||
This expression is aimed to detangle whether an entire given string is a number of exponential format or not. | ||
**exponentialNumberFormatRegex** unites three checks: | ||
- **e** or **E** separator between **right part** and **left part** of number | ||
- **right part** must be a **decimal integer number** with optional **-** sign | ||
- **left part** must be a **decimal float number** with optional sign | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70014
34
1001
672