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.
Files changed (36) hide show
  1. package/.github/workflows/node.js.yml +1 -1
  2. package/.tasks/_utils.mjs +66 -0
  3. package/.tasks/builds/build.mjs +65 -0
  4. package/.tasks/cleans/clean.mjs +20 -0
  5. package/.tasks/docs/doc.mjs +37 -0
  6. package/.tasks/helps/help.mjs +195 -0
  7. package/.tasks/lints/lint.mjs +33 -0
  8. package/.tasks/patches/patch.mjs +9 -0
  9. package/.tasks/tests/benchmarks/bundle-benchmarks.mjs +33 -0
  10. package/.tasks/tests/benchmarks/compute-benchmarks.mjs +215 -0
  11. package/.tasks/tests/benchmarks/run-benchmarks-for-backend.mjs +24 -0
  12. package/.tasks/tests/benchmarks/run-benchmarks-for-frontend.mjs +38 -0
  13. package/.tasks/tests/bundling/check-bundling-from-esm-build-import.mjs +167 -0
  14. package/.tasks/tests/bundling/check-bundling-from-esm-files-direct.mjs +129 -0
  15. package/.tasks/tests/bundling/check-bundling-from-esm-files-import.mjs +149 -0
  16. package/.tasks/tests/unit-tests/bundle-unit-tests.mjs +33 -0
  17. package/.tasks/tests/unit-tests/compute-unit-tests.mjs +578 -0
  18. package/.tasks/tests/unit-tests/run-unit-tests-for-backend.mjs +25 -0
  19. package/.tasks/tests/unit-tests/run-unit-tests-for-frontend.mjs +41 -0
  20. package/CHANGELOG.md +10 -0
  21. package/builds/itee-validators.cjs.js +18 -10
  22. package/builds/itee-validators.cjs.js.map +1 -1
  23. package/builds/itee-validators.cjs.min.js +62 -62
  24. package/builds/itee-validators.esm.js +2 -2
  25. package/builds/itee-validators.iife.js +4 -3
  26. package/builds/itee-validators.iife.js.map +1 -1
  27. package/builds/itee-validators.iife.min.js +17 -17
  28. package/package.json +1 -1
  29. package/sources/file-system/block-devices/isBlockDevicePath.js +2 -1
  30. package/sources/file-system/character-devices/isCharacterDevicePath.js +2 -1
  31. package/sources/file-system/directories/isDirectoryPath.js +2 -1
  32. package/sources/file-system/fifo-pipes/isFIFOPath.js +2 -1
  33. package/sources/file-system/files/isEmptyFile.js +2 -1
  34. package/sources/file-system/files/isFilePath.js +2 -1
  35. package/sources/file-system/sockets/isSocketPath.js +2 -1
  36. 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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
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 } );