itee-validators 5.5.1 → 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 (34) 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 +8 -0
  21. package/builds/itee-validators.cjs.js +20 -12
  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 +4 -4
  25. package/builds/itee-validators.iife.js +4 -4
  26. package/package.json +1 -1
  27. package/sources/file-system/block-devices/isBlockDevicePath.js +2 -1
  28. package/sources/file-system/character-devices/isCharacterDevicePath.js +2 -1
  29. package/sources/file-system/directories/isDirectoryPath.js +2 -1
  30. package/sources/file-system/fifo-pipes/isFIFOPath.js +2 -1
  31. package/sources/file-system/files/isEmptyFile.js +2 -1
  32. package/sources/file-system/files/isFilePath.js +2 -1
  33. package/sources/file-system/sockets/isSocketPath.js +2 -1
  34. package/sources/file-system/symbolic-links/isSymbolicLinkPath.js +2 -1
@@ -31,7 +31,8 @@ import { isNotString } from '../../cores/strings/isString'
31
31
  */
32
32
  export function isDirectoryPath( path ) {
33
33
  if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
34
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
34
+ return false
35
+ // throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
35
36
  }
36
37
 
37
38
  const stat = statSync( path, { throwIfNoEntry: false } )
@@ -31,7 +31,8 @@ import { isNotString } from '../../cores/strings/isString'
31
31
  */
32
32
  export function isFIFOPath( path ) {
33
33
  if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
34
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
34
+ return false
35
+ // throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
35
36
  }
36
37
 
37
38
  const stat = statSync( path, { throwIfNoEntry: false } )
@@ -32,7 +32,8 @@ import { isNotString } from '../../cores/strings/isString'
32
32
  */
33
33
  export function isEmptyFile( filePath, threshold = 0 ) {
34
34
  if ( isNotString( filePath ) && !( filePath instanceof Buffer ) && !( filePath instanceof URL ) ) {
35
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
35
+ return false
36
+ // throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
36
37
  }
37
38
 
38
39
  return isFilePath( filePath ) && ( statSync( filePath ).size <= threshold )
@@ -31,7 +31,8 @@ import { isNotString } from '../../cores/strings/isString'
31
31
  */
32
32
  export function isFilePath( path ) {
33
33
  if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
34
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
34
+ return false
35
+ // throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
35
36
  }
36
37
 
37
38
  const stat = statSync( path, { throwIfNoEntry: false } )
@@ -31,7 +31,8 @@ import { isNotString } from '../../cores/strings/isString'
31
31
  */
32
32
  export function isSocketPath( path ) {
33
33
  if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
34
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
34
+ return false
35
+ // throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
35
36
  }
36
37
 
37
38
  const stat = statSync( path, { throwIfNoEntry: false } )
@@ -31,7 +31,8 @@ import { isNotString } from '../../cores/strings/isString'
31
31
  */
32
32
  export function isSymbolicLinkPath( path ) {
33
33
  if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
34
- throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
34
+ return false
35
+ // throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
35
36
  }
36
37
 
37
38
  const stat = statSync( path, { throwIfNoEntry: false } )