itee-validators 5.5.0 → 5.6.0
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/.github/workflows/node.js.yml +1 -1
- package/.tasks/_utils.mjs +66 -0
- package/.tasks/builds/build.mjs +65 -0
- package/.tasks/cleans/clean.mjs +20 -0
- package/.tasks/docs/doc.mjs +37 -0
- package/.tasks/helps/help.mjs +195 -0
- package/.tasks/lints/lint.mjs +33 -0
- package/.tasks/patches/patch.mjs +9 -0
- package/.tasks/tests/benchmarks/bundle-benchmarks.mjs +33 -0
- package/.tasks/tests/benchmarks/compute-benchmarks.mjs +215 -0
- package/.tasks/tests/benchmarks/run-benchmarks-for-backend.mjs +24 -0
- package/.tasks/tests/benchmarks/run-benchmarks-for-frontend.mjs +38 -0
- package/.tasks/tests/bundling/check-bundling-from-esm-build-import.mjs +167 -0
- package/.tasks/tests/bundling/check-bundling-from-esm-files-direct.mjs +129 -0
- package/.tasks/tests/bundling/check-bundling-from-esm-files-import.mjs +149 -0
- package/.tasks/tests/unit-tests/bundle-unit-tests.mjs +33 -0
- package/.tasks/tests/unit-tests/compute-unit-tests.mjs +578 -0
- package/.tasks/tests/unit-tests/run-unit-tests-for-backend.mjs +25 -0
- package/.tasks/tests/unit-tests/run-unit-tests-for-frontend.mjs +41 -0
- package/CHANGELOG.md +10 -0
- package/builds/itee-validators.cjs.js +18 -10
- package/builds/itee-validators.cjs.js.map +1 -1
- package/builds/itee-validators.cjs.min.js +62 -62
- package/builds/itee-validators.esm.js +2 -2
- package/builds/itee-validators.iife.js +4 -3
- package/builds/itee-validators.iife.js.map +1 -1
- package/builds/itee-validators.iife.min.js +17 -17
- package/package.json +1 -1
- package/sources/file-system/block-devices/isBlockDevicePath.js +2 -1
- package/sources/file-system/character-devices/isCharacterDevicePath.js +2 -1
- package/sources/file-system/directories/isDirectoryPath.js +2 -1
- package/sources/file-system/fifo-pipes/isFIFOPath.js +2 -1
- package/sources/file-system/files/isEmptyFile.js +2 -1
- package/sources/file-system/files/isFilePath.js +2 -1
- package/sources/file-system/sockets/isSocketPath.js +2 -1
- package/sources/file-system/symbolic-links/isSymbolicLinkPath.js +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ┳ ┓┏ ┓• ┓ ┏━
|
|
3
|
-
* ┃╋┏┓┏┓ ┃┃┏┓┃┓┏┫┏┓╋┏┓┏┓┏ ┓┏┗┓
|
|
2
|
+
* ┳ ┓┏ ┓• ┓ ┏━ ┏┓ ┏┓ ┏┓ ┏┳
|
|
3
|
+
* ┃╋┏┓┏┓ ┃┃┏┓┃┓┏┫┏┓╋┏┓┏┓┏ ┓┏┗┓ ┣┓ ┃┫ ━━ ┃ ┏┓┏┳┓┏┳┓┏┓┏┓ ┃┏
|
|
4
4
|
* ┻┗┗ ┗ •┗┛┗┻┗┗┗┻┗┻┗┗┛┛ ┛ ┗┛┗┛•┗┛•┗┛ ┗┛┗┛┛┗┗┛┗┗┗┛┛┗┗┛┛
|
|
5
5
|
*
|
|
6
6
|
* @desc A library of validation functions use in various Itee projects
|
|
@@ -2465,7 +2465,8 @@ function isNotTemperature( data ) {
|
|
|
2465
2465
|
*/
|
|
2466
2466
|
function isBlockDevicePath( path ) {
|
|
2467
2467
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
2468
|
-
|
|
2468
|
+
return false
|
|
2469
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
2469
2470
|
}
|
|
2470
2471
|
|
|
2471
2472
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|
|
@@ -2590,7 +2591,8 @@ function isInvalidBlockDevicePath( data ) {
|
|
|
2590
2591
|
*/
|
|
2591
2592
|
function isCharacterDevicePath( path ) {
|
|
2592
2593
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
2593
|
-
|
|
2594
|
+
return false
|
|
2595
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
2594
2596
|
}
|
|
2595
2597
|
|
|
2596
2598
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|
|
@@ -2674,7 +2676,8 @@ function isInvalidCharacterDevicePath( data ) {
|
|
|
2674
2676
|
*/
|
|
2675
2677
|
function isDirectoryPath( path ) {
|
|
2676
2678
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
2677
|
-
|
|
2679
|
+
return false
|
|
2680
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
2678
2681
|
}
|
|
2679
2682
|
|
|
2680
2683
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|
|
@@ -2799,7 +2802,8 @@ function isInvalidDirectoryPath( data ) {
|
|
|
2799
2802
|
*/
|
|
2800
2803
|
function isFIFOPath( path ) {
|
|
2801
2804
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
2802
|
-
|
|
2805
|
+
return false
|
|
2806
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
2803
2807
|
}
|
|
2804
2808
|
|
|
2805
2809
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|
|
@@ -2886,7 +2890,8 @@ function isInvalidFIFOPath( data ) {
|
|
|
2886
2890
|
*/
|
|
2887
2891
|
function isFilePath( path ) {
|
|
2888
2892
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
2889
|
-
|
|
2893
|
+
return false
|
|
2894
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
2890
2895
|
}
|
|
2891
2896
|
|
|
2892
2897
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|
|
@@ -2933,7 +2938,8 @@ function isNotFilePath( path ) {
|
|
|
2933
2938
|
*/
|
|
2934
2939
|
function isEmptyFile( filePath, threshold = 0 ) {
|
|
2935
2940
|
if ( isNotString( filePath ) && !( filePath instanceof Buffer ) && !( filePath instanceof URL ) ) {
|
|
2936
|
-
|
|
2941
|
+
return false
|
|
2942
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
2937
2943
|
}
|
|
2938
2944
|
|
|
2939
2945
|
return isFilePath( filePath ) && ( fs.statSync( filePath ).size <= threshold )
|
|
@@ -3017,7 +3023,8 @@ function isInvalidFilePath( data ) {
|
|
|
3017
3023
|
*/
|
|
3018
3024
|
function isSocketPath( path ) {
|
|
3019
3025
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
3020
|
-
|
|
3026
|
+
return false
|
|
3027
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
3021
3028
|
}
|
|
3022
3029
|
|
|
3023
3030
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|
|
@@ -3101,7 +3108,8 @@ function isInvalidSocketPath( data ) {
|
|
|
3101
3108
|
*/
|
|
3102
3109
|
function isSymbolicLinkPath( path ) {
|
|
3103
3110
|
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
3104
|
-
|
|
3111
|
+
return false
|
|
3112
|
+
// throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
3105
3113
|
}
|
|
3106
3114
|
|
|
3107
3115
|
const stat = fs.statSync( path, { throwIfNoEntry: false } );
|