itee-validators 5.6.0 → 6.1.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 (103) hide show
  1. package/.github/workflows/publish.yml +61 -0
  2. package/.releaserc.mjs +94 -0
  3. package/.tasks/configs/lints/lint.conf.mjs +42 -0
  4. package/.tasks/configs/tests/benchmarks/compute-benchmarks.conf.mjs +5 -0
  5. package/.tasks/configs/tests/benchmarks/run-benchmarks-for-frontend.conf.mjs +5 -0
  6. package/.tasks/configs/tests/units/run-unit-tests-for-frontend.conf.mjs +5 -0
  7. package/CHANGELOG.md +25 -0
  8. package/builds/{itee-validators.cjs.js → validators.cjs} +56 -18
  9. package/builds/validators.cjs.map +1 -0
  10. package/builds/{itee-validators.iife.js → validators.js} +28 -7
  11. package/builds/validators.js.map +1 -0
  12. package/builds/{itee-validators.cjs.min.js → validators.min.cjs} +36 -35
  13. package/builds/{itee-validators.iife.min.js → validators.min.js} +10 -10
  14. package/builds/{itee-validators.esm.min.js → validators.min.mjs} +3 -3
  15. package/builds/{itee-validators.esm.js → validators.mjs} +28 -5
  16. package/builds/validators.mjs.map +1 -0
  17. package/package.json +27 -52
  18. package/sources/cores/_cores.js +10 -10
  19. package/sources/cores/arrays/_arrays.js +12 -12
  20. package/sources/cores/arrays/isArrayOfArray.js +2 -2
  21. package/sources/cores/arrays/isArrayOfBoolean.js +3 -3
  22. package/sources/cores/arrays/isArrayOfFunction.js +3 -3
  23. package/sources/cores/arrays/isArrayOfMultiElement.js +1 -1
  24. package/sources/cores/arrays/isArrayOfNull.js +3 -3
  25. package/sources/cores/arrays/isArrayOfNumber.js +3 -3
  26. package/sources/cores/arrays/isArrayOfObject.js +3 -3
  27. package/sources/cores/arrays/isArrayOfSingleElement.js +1 -1
  28. package/sources/cores/arrays/isArrayOfString.js +3 -3
  29. package/sources/cores/arrays/isArrayOfUndefined.js +3 -3
  30. package/sources/cores/arrays/isEmptyArray.js +1 -1
  31. package/sources/cores/booleans/_booleans.js +2 -2
  32. package/sources/cores/booleans/isTrue.js +1 -1
  33. package/sources/cores/cores.js +8 -8
  34. package/sources/cores/functions/_functions.js +1 -1
  35. package/sources/cores/numbers/_numbers.js +6 -6
  36. package/sources/cores/numbers/isNumber.js +3 -3
  37. package/sources/cores/objects/_objects.js +2 -2
  38. package/sources/cores/objects/isEmptyObject.js +1 -1
  39. package/sources/cores/objects/isObject.js +1 -1
  40. package/sources/cores/strings/_strings.js +3 -3
  41. package/sources/cores/strings/isBlankString.js +2 -2
  42. package/sources/cores/strings/isEmptyString.js +1 -1
  43. package/sources/cores/symbols/_symbols.js +1 -1
  44. package/sources/cores/tests/isTestUnitGenerator.js +5 -6
  45. package/sources/cores/typed-arrays/_typedArrays.js +12 -12
  46. package/sources/cores/voids/_voids.js +4 -4
  47. package/sources/cores/voids/isEmpty.js +4 -4
  48. package/sources/file-system/_file-system.js +9 -9
  49. package/sources/file-system/block-devices/_blockDevices.js +3 -3
  50. package/sources/file-system/block-devices/isBlockDevicePath.js +3 -3
  51. package/sources/file-system/block-devices/isValidBlockDevicePath.js +2 -2
  52. package/sources/file-system/character-devices/_characterDevices.js +3 -3
  53. package/sources/file-system/character-devices/isCharacterDevicePath.js +3 -3
  54. package/sources/file-system/character-devices/isValidCharacterDevicePath.js +2 -2
  55. package/sources/file-system/directories/_directories.js +4 -4
  56. package/sources/file-system/directories/isDirectoryPath.js +3 -3
  57. package/sources/file-system/directories/isEmptyDirectory.js +2 -2
  58. package/sources/file-system/directories/isValidDirectoryPath.js +2 -2
  59. package/sources/file-system/fifo-pipes/_fifoPipes.js +3 -3
  60. package/sources/file-system/fifo-pipes/isFIFOPath.js +3 -3
  61. package/sources/file-system/fifo-pipes/isValidFIFOPath.js +2 -2
  62. package/sources/file-system/files/_files.js +4 -4
  63. package/sources/file-system/files/isEmptyFile.js +3 -3
  64. package/sources/file-system/files/isFilePath.js +3 -3
  65. package/sources/file-system/files/isValidFilePath.js +2 -2
  66. package/sources/file-system/paths/_paths.js +2 -2
  67. package/sources/file-system/paths/isValidPath.js +1 -1
  68. package/sources/file-system/sockets/_sockets.js +3 -3
  69. package/sources/file-system/sockets/isSocketPath.js +3 -3
  70. package/sources/file-system/sockets/isValidSocketPath.js +2 -2
  71. package/sources/file-system/symbolic-links/_symbolicLinks.js +3 -3
  72. package/sources/file-system/symbolic-links/isSymbolicLinkPath.js +3 -3
  73. package/sources/file-system/symbolic-links/isValidSymbolicLinkPath.js +2 -2
  74. package/sources/maths/_maths.js +1 -1
  75. package/sources/physics/_physics.js +2 -2
  76. package/sources/physics/temperatures/_temperatures.js +5 -5
  77. package/sources/physics/temperatures/isCelsius.js +2 -2
  78. package/sources/physics/temperatures/isFahrenheit.js +2 -2
  79. package/sources/physics/temperatures/isKelvin.js +2 -2
  80. package/sources/physics/temperatures/isTemperature.js +3 -3
  81. package/sources/{itee-validators.js → validators.js} +4 -4
  82. package/.github/workflows/node.js.yml +0 -53
  83. package/.tasks/_utils.mjs +0 -66
  84. package/.tasks/builds/build.mjs +0 -65
  85. package/.tasks/cleans/clean.mjs +0 -20
  86. package/.tasks/docs/doc.mjs +0 -37
  87. package/.tasks/helps/help.mjs +0 -195
  88. package/.tasks/lints/lint.mjs +0 -33
  89. package/.tasks/patches/patch.mjs +0 -9
  90. package/.tasks/tests/benchmarks/bundle-benchmarks.mjs +0 -33
  91. package/.tasks/tests/benchmarks/compute-benchmarks.mjs +0 -215
  92. package/.tasks/tests/benchmarks/run-benchmarks-for-backend.mjs +0 -24
  93. package/.tasks/tests/benchmarks/run-benchmarks-for-frontend.mjs +0 -38
  94. package/.tasks/tests/bundling/check-bundling-from-esm-build-import.mjs +0 -167
  95. package/.tasks/tests/bundling/check-bundling-from-esm-files-direct.mjs +0 -129
  96. package/.tasks/tests/bundling/check-bundling-from-esm-files-import.mjs +0 -149
  97. package/.tasks/tests/unit-tests/bundle-unit-tests.mjs +0 -33
  98. package/.tasks/tests/unit-tests/compute-unit-tests.mjs +0 -578
  99. package/.tasks/tests/unit-tests/run-unit-tests-for-backend.mjs +0 -25
  100. package/.tasks/tests/unit-tests/run-unit-tests-for-frontend.mjs +0 -41
  101. package/builds/itee-validators.cjs.js.map +0 -1
  102. package/builds/itee-validators.esm.js.map +0 -1
  103. package/builds/itee-validators.iife.js.map +0 -1
@@ -19,9 +19,9 @@
19
19
  *
20
20
  */
21
21
 
22
- import { statSync } from 'fs'
23
- import { isFilePath } from './isFilePath'
24
- import { isNotString } from '../../cores/strings/isString'
22
+ import { statSync } from 'node:fs'
23
+ import { isNotString } from '../../cores/strings/isString.js'
24
+ import { isFilePath } from './isFilePath.js'
25
25
 
26
26
  /**
27
27
  * Check if given file path is an empty file more or less a threshold in bytes.
@@ -19,9 +19,9 @@
19
19
  *
20
20
  */
21
21
 
22
- import { statSync } from 'fs'
23
- import { isDefined } from '../../cores/voids/isDefined'
24
- import { isNotString } from '../../cores/strings/isString'
22
+ import { statSync } from 'node:fs'
23
+ import { isNotString } from '../../cores/strings/isString.js'
24
+ import { isDefined } from '../../cores/voids/isDefined.js'
25
25
 
26
26
  /**
27
27
  * Check if given path is a file path
@@ -16,8 +16,8 @@
16
16
  *
17
17
  */
18
18
 
19
- import { isValidPath } from '../paths/isValidPath'
20
- import { isFilePath } from './isFilePath'
19
+ import { isValidPath } from '../paths/isValidPath.js'
20
+ import { isFilePath } from './isFilePath.js'
21
21
 
22
22
  /**
23
23
  * Check if given data is a valid file path
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * @module sources/file-system/paths
6
6
  * @description This is the files paths main export entry point.
7
- * It expose all exports of the files paths validators.
7
+ * It exposes all exports of the files paths validators.
8
8
  *
9
9
  */
10
10
 
11
- export * from './isValidPath'
11
+ export * from './isValidPath.js'
@@ -19,7 +19,7 @@
19
19
  *
20
20
  */
21
21
 
22
- import { existsSync } from 'fs'
22
+ import { existsSync } from 'node:fs'
23
23
 
24
24
  /**
25
25
  * Check if given data is a valid file path
@@ -4,9 +4,9 @@
4
4
  *
5
5
  * @module sources/file-system/sockets
6
6
  * @description This is the sockets main export entry point.
7
- * It expose all exports of the sockets validators.
7
+ * It exposes all exports of the sockets validators.
8
8
  *
9
9
  */
10
10
 
11
- export * from './isSocketPath'
12
- export * from './isValidSocketPath'
11
+ export * from './isSocketPath.js'
12
+ export * from './isValidSocketPath.js'
@@ -19,9 +19,9 @@
19
19
  *
20
20
  */
21
21
 
22
- import { statSync } from 'fs'
23
- import { isDefined } from '../../cores/voids/isDefined'
24
- import { isNotString } from '../../cores/strings/isString'
22
+ import { statSync } from 'node:fs'
23
+ import { isNotString } from '../../cores/strings/isString.js'
24
+ import { isDefined } from '../../cores/voids/isDefined.js'
25
25
 
26
26
  /**
27
27
  * Check if given path is a socket path
@@ -16,8 +16,8 @@
16
16
  *
17
17
  */
18
18
 
19
- import { isValidPath } from '../paths/isValidPath'
20
- import { isSocketPath } from './isSocketPath'
19
+ import { isValidPath } from '../paths/isValidPath.js'
20
+ import { isSocketPath } from './isSocketPath.js'
21
21
 
22
22
  /**
23
23
  * Check if given data is a valid socket path
@@ -4,9 +4,9 @@
4
4
  *
5
5
  * @module sources/file-system/symbolic-links
6
6
  * @description This is the symbolic-links main export entry point.
7
- * It expose all exports of the symbolic-links validators.
7
+ * It exposes all exports of the symbolic-links validators.
8
8
  *
9
9
  */
10
10
 
11
- export * from './isSymbolicLinkPath'
12
- export * from './isValidSymbolicLinkPath'
11
+ export * from './isSymbolicLinkPath.js'
12
+ export * from './isValidSymbolicLinkPath.js'
@@ -19,9 +19,9 @@
19
19
  *
20
20
  */
21
21
 
22
- import { statSync } from 'fs'
23
- import { isDefined } from '../../cores/voids/isDefined'
24
- import { isNotString } from '../../cores/strings/isString'
22
+ import { statSync } from 'node:fs'
23
+ import { isNotString } from '../../cores/strings/isString.js'
24
+ import { isDefined } from '../../cores/voids/isDefined.js'
25
25
 
26
26
  /**
27
27
  * Check if given path is a symbolic link path
@@ -16,8 +16,8 @@
16
16
  *
17
17
  */
18
18
 
19
- import { isValidPath } from '../paths/isValidPath'
20
- import { isSymbolicLinkPath } from './isSymbolicLinkPath'
19
+ import { isValidPath } from '../paths/isValidPath.js'
20
+ import { isSymbolicLinkPath } from './isSymbolicLinkPath.js'
21
21
 
22
22
  /**
23
23
  * Check if given data is a valid symbolic link path
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @module sources/maths
6
6
  * @description This is the maths export entry point.
7
- * It expose all exports of the ... sub-folder.
7
+ * It exposes all exports of the ... sub-folder.
8
8
  *
9
9
  */
10
10
 
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * @module sources/physics
6
6
  * @description This is the physics export entry point.
7
- * It expose all exports of the temperatures sub-folder.
7
+ * It exposes all exports of the temperatures sub-folder.
8
8
  *
9
9
  */
10
10
 
11
- export * from './temperatures/_temperatures'
11
+ export * from './temperatures/_temperatures.js'
@@ -6,8 +6,8 @@
6
6
  * @description Export the validation methods about temperatures
7
7
  */
8
8
 
9
- export * from './constants'
10
- export * from './isCelsius'
11
- export * from './isFahrenheit'
12
- export * from './isKelvin'
13
- export * from './isTemperature'
9
+ export * from './constants.js'
10
+ export * from './isCelsius.js'
11
+ export * from './isFahrenheit.js'
12
+ export * from './isKelvin.js'
13
+ export * from './isTemperature.js'
@@ -16,8 +16,8 @@
16
16
  *
17
17
  */
18
18
 
19
- import { isNumber } from '../../cores/numbers/isNumber'
20
- import { ABSOLUTE_ZERO_CELSIUS } from './constants'
19
+ import { isNumber } from '../../cores/numbers/isNumber.js'
20
+ import { ABSOLUTE_ZERO_CELSIUS } from './constants.js'
21
21
 
22
22
  /**
23
23
  *
@@ -16,8 +16,8 @@
16
16
  *
17
17
  */
18
18
 
19
- import { isNumber } from '../../cores/numbers/isNumber'
20
- import { ABSOLUTE_ZERO_FAHRENHEIT } from './constants'
19
+ import { isNumber } from '../../cores/numbers/isNumber.js'
20
+ import { ABSOLUTE_ZERO_FAHRENHEIT } from './constants.js'
21
21
 
22
22
  /**
23
23
  *
@@ -16,8 +16,8 @@
16
16
  *
17
17
  */
18
18
 
19
- import { isNumber } from '../../cores/numbers/isNumber'
20
- import { ABSOLUTE_ZERO_KELVIN } from './constants'
19
+ import { isNumber } from '../../cores/numbers/isNumber.js'
20
+ import { ABSOLUTE_ZERO_KELVIN } from './constants.js'
21
21
 
22
22
  /**
23
23
  *
@@ -19,15 +19,15 @@
19
19
  import {
20
20
  isCelsius,
21
21
  isNotCelsius
22
- } from './isCelsius'
22
+ } from './isCelsius.js'
23
23
  import {
24
24
  isFahrenheit,
25
25
  isNotFahrenheit
26
- } from './isFahrenheit'
26
+ } from './isFahrenheit.js'
27
27
  import {
28
28
  isKelvin,
29
29
  isNotKelvin
30
- } from './isKelvin'
30
+ } from './isKelvin.js'
31
31
 
32
32
  /**
33
33
  *
@@ -8,10 +8,10 @@
8
8
  * In case you're using the commons js build, you will get the file-system validators too.
9
9
  */
10
10
 
11
- export * from './cores/_cores'
12
- export * from './maths/_maths'
13
- export * from './physics/_physics'
11
+ export * from './cores/_cores.js'
12
+ export * from './maths/_maths.js'
13
+ export * from './physics/_physics.js'
14
14
 
15
15
  // #if IS_BACKEND_SPECIFIC
16
- export * from './file-system/_file-system'
16
+ export * from './file-system/_file-system.js'
17
17
  // #endif
@@ -1,53 +0,0 @@
1
- # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name: Itee-Validators CI
5
-
6
- on:
7
- push:
8
- branches: [ master ]
9
- pull_request:
10
- branches: [ master ]
11
-
12
- jobs:
13
- build:
14
- runs-on: ubuntu-latest
15
- env:
16
- MOZ_HEADLESS: 1
17
- strategy:
18
- matrix:
19
- node-version: [ 18.x, 20.x, 22.x ]
20
- firefox: [ 'latest' ]
21
- steps:
22
- - name: Use Node.js ${{ matrix.node-version }}
23
- uses: actions/setup-node@v2
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
- - name: Setup Firefox ${{ matrix.firefox }}
27
- uses: browser-actions/setup-firefox@latest
28
- with:
29
- firefox-version: ${{ matrix.firefox }}
30
- - name: Checkout ${{ env.GITHUB_REPOSITORY }}
31
- uses: actions/checkout@v2
32
- - name: Install dependencies
33
- run: npm ci
34
- - name: Release
35
- run: npm run lint && npm run build && npm run build-test && npm run test
36
-
37
- publish:
38
- needs: build
39
- runs-on: ubuntu-latest
40
- env:
41
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43
- steps:
44
- - name: Use Node.js ${{ matrix.node-version }}
45
- uses: actions/setup-node@v2
46
- with:
47
- node-version: "lts/*"
48
- - name: Checkout ${{ env.GITHUB_REPOSITORY }}
49
- uses: actions/checkout@v2
50
- - name: Install dependencies
51
- run: npm ci
52
- - name: Semantic Release
53
- run: npm run clean && npm run lint && npm run doc && npm run build && npx semantic-release
package/.tasks/_utils.mjs DELETED
@@ -1,66 +0,0 @@
1
- import {
2
- join,
3
- dirname
4
- } from 'path'
5
- import { readFileSync } from 'fs'
6
- import { fileURLToPath } from 'url'
7
-
8
- // We cannot use directly the import.meta.dirname or filename because all IDE usage do not produce them
9
- // We use
10
- function getDirname() {
11
-
12
- let __dirname
13
-
14
- if ( import.meta.dirname ) {
15
- __dirname = import.meta.dirname
16
- } else if ( import.meta.filename ) {
17
- __dirname = dirname( import.meta.filename )
18
- } else if ( import.meta.url ) {
19
- const __filename = fileURLToPath( import.meta.url )
20
- __dirname = dirname( __filename )
21
- } else {
22
- throw new Error( 'Unable to retrieve module dirname.' )
23
- }
24
-
25
- // Todo: distinguish between dirname and packageRootFolder to avoid misusing
26
- __dirname = join( __dirname, '..' )
27
-
28
- return __dirname
29
-
30
- }
31
-
32
- const __dirname = getDirname()
33
- const packagePath = join( __dirname, 'package.json' )
34
- const packageData = readFileSync( packagePath )
35
- const packageInfos = JSON.parse( packageData )
36
-
37
- class Indenter {
38
-
39
- _ = ''
40
- __ = ''
41
- ___ = ''
42
- ____ = ''
43
- _____ = ''
44
- ______ = ''
45
- _______ = ''
46
- ________ = ''
47
- _________ = ''
48
- __________ = ''
49
-
50
- constructor( indentationChar = '\t', maxIndentationLevel = 10 ) {
51
-
52
- let currentProperty = '_'
53
- for ( let currentIndentationLevel = 1 ; currentIndentationLevel <= maxIndentationLevel ; currentIndentationLevel++ ) {
54
- this[ currentProperty ] = indentationChar.repeat( currentIndentationLevel )
55
- currentProperty += '_'
56
- }
57
-
58
- }
59
-
60
- }
61
-
62
- export {
63
- packageInfos,
64
- Indenter,
65
- getDirname
66
- }
@@ -1,65 +0,0 @@
1
- import { join } from 'path'
2
- import rollupConfigurator from '../../configs/rollup.conf.js'
3
- import parseArgs from 'minimist'
4
- import { getDirname } from '../_utils.mjs'
5
- import { packageInfos } from '../_utils.mjs'
6
- import { rollup } from 'rollup'
7
- import log from 'fancy-log'
8
-
9
- function build( done ) {
10
-
11
- const __dirname = getDirname()
12
-
13
- const options = parseArgs( process.argv, {
14
- string: [ 'n', 'i', 'f', 'e' ],
15
- boolean: [ 's', 't' ],
16
- default: {
17
- i: join( __dirname, 'sources', `${ packageInfos.name }.js` ),
18
- o: join( __dirname, 'builds' ),
19
- f: [ 'esm', 'cjs', 'iife' ],
20
- e: [ 'dev', 'prod' ],
21
- s: true,
22
- t: true
23
- },
24
- alias: {
25
- i: 'input',
26
- o: 'output',
27
- f: 'formats',
28
- e: 'envs',
29
- s: 'sourcemap',
30
- t: 'treeshake'
31
- }
32
- } )
33
-
34
- const configs = rollupConfigurator( options )
35
-
36
- nextBuild()
37
-
38
- function nextBuild( error ) {
39
- 'use strict'
40
-
41
- if ( error ) {
42
-
43
- done( error )
44
-
45
- } else if ( configs.length === 0 ) {
46
-
47
- done()
48
-
49
- } else {
50
-
51
- const config = configs.pop()
52
- log( `Building ${ config.output.file }` )
53
-
54
- rollup( config )
55
- .then( ( bundle ) => { return bundle.write( config.output ) } )
56
- .then( () => { nextBuild() } )
57
- .catch( nextBuild )
58
-
59
- }
60
-
61
- }
62
-
63
- }
64
-
65
- export { build }
@@ -1,20 +0,0 @@
1
- import { getGulpConfigForTask } from '../../configs/gulp.conf.mjs'
2
- import { deleteAsync } from 'del'
3
- import log from 'fancy-log'
4
- import colors from 'ansi-colors'
5
-
6
- const red = colors.red
7
-
8
- function clean( done ) {
9
-
10
- const filesToClean = getGulpConfigForTask( 'clean' )
11
-
12
- for ( let fileIndex = 0, numberOfFiles = filesToClean.length ; fileIndex < numberOfFiles ; fileIndex++ ) {
13
- log( red( `[${ fileIndex + 1 }/${ numberOfFiles }] Delete ${ filesToClean[ fileIndex ] }` ) )
14
- }
15
-
16
- return deleteAsync( filesToClean )
17
-
18
- }
19
-
20
- export { clean }
@@ -1,37 +0,0 @@
1
- import log from 'fancy-log'
2
- import jsdocConfiguration from '../../configs/jsdoc.conf.js'
3
- import { getGulpConfigForTask } from '../../configs/gulp.conf.mjs'
4
- import gulp from 'gulp'
5
- import jsdoc from 'gulp-jsdoc3'
6
-
7
-
8
- async function doc( done ) {
9
-
10
- const config = jsdocConfiguration
11
- const filesToDoc = getGulpConfigForTask( 'doc' )
12
-
13
- for ( let fileIndex = 0, numberOfFiles = filesToDoc.length ; fileIndex < numberOfFiles ; fileIndex++ ) {
14
- log( `[${ fileIndex + 1 }/${ numberOfFiles }] Documenting ${ filesToDoc[ fileIndex ] }` )
15
- }
16
-
17
- // gulp
18
- // .src( filesToDoc, {
19
- // read: false,
20
- // allowEmpty: true
21
- // } )
22
- // .pipe( jsdoc( config, done ) )
23
- // .on( 'error', done )
24
-
25
- await new Promise( ( ( resolve, reject ) => {
26
- gulp.src( filesToDoc, {
27
- read: false,
28
- allowEmpty: true
29
- } )
30
- .pipe( jsdoc( config, resolve ) )
31
- .on( 'error', reject )
32
- } ) )
33
- done()
34
-
35
- }
36
-
37
- export { doc }