itee-validators 5.3.8 → 5.4.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/CHANGELOG.md +22 -0
- package/builds/itee-validators.cjs.js +278 -277
- package/builds/itee-validators.cjs.js.map +1 -1
- package/builds/itee-validators.cjs.min.js +144 -144
- package/builds/itee-validators.esm.js +210 -205
- package/builds/itee-validators.esm.js.map +1 -1
- package/builds/itee-validators.esm.min.js +97 -97
- package/builds/itee-validators.iife.js +210 -205
- package/builds/itee-validators.iife.js.map +1 -1
- package/builds/itee-validators.iife.min.js +115 -115
- package/package.json +4 -2
- package/sources/cores/arrays/isArray.js +4 -4
- package/sources/cores/arrays/isArrayOfArray.js +2 -2
- package/sources/cores/arrays/isArrayOfBoolean.js +2 -2
- package/sources/cores/arrays/isArrayOfFunction.js +2 -2
- package/sources/cores/arrays/isArrayOfMultiElement.js +1 -1
- package/sources/cores/arrays/isArrayOfNull.js +2 -2
- package/sources/cores/arrays/isArrayOfNumber.js +2 -2
- package/sources/cores/arrays/isArrayOfObject.js +2 -2
- package/sources/cores/arrays/isArrayOfSingleElement.js +1 -1
- package/sources/cores/arrays/isArrayOfString.js +3 -3
- package/sources/cores/arrays/isArrayOfUndefined.js +2 -2
- package/sources/cores/arrays/isEmptyArray.js +2 -2
- package/sources/cores/booleans/isBoolean.js +4 -4
- package/sources/cores/booleans/isTrue.js +2 -2
- package/sources/cores/cores.js +91 -91
- package/sources/cores/functions/isFunction.js +2 -2
- package/sources/cores/numbers/isInfinite.js +13 -19
- package/sources/cores/numbers/isMax.js +2 -2
- package/sources/cores/numbers/isMin.js +2 -2
- package/sources/cores/numbers/isNumber.js +15 -15
- package/sources/cores/numbers/isSafeInteger.js +2 -2
- package/sources/cores/numbers/isZero.js +3 -3
- package/sources/cores/objects/isEmptyObject.js +2 -2
- package/sources/cores/objects/isObject.js +2 -2
- package/sources/cores/strings/isBlankString.js +2 -2
- package/sources/cores/strings/isEmptyString.js +2 -2
- package/sources/cores/strings/isString.js +7 -7
- package/sources/cores/symbols/isSymbol.js +2 -2
- package/sources/cores/tests/isTestUnitGenerator.js +10 -10
- package/sources/cores/typed-arrays/isArrayBuffer.js +2 -2
- package/sources/cores/typed-arrays/isBigInt64Array.js +2 -2
- package/sources/cores/typed-arrays/isBigUint64Array.js +2 -2
- package/sources/cores/typed-arrays/isFloat32Array.js +2 -2
- package/sources/cores/typed-arrays/isFloat64Array.js +2 -2
- package/sources/cores/typed-arrays/isInt16Array.js +2 -2
- package/sources/cores/typed-arrays/isInt32Array.js +2 -2
- package/sources/cores/typed-arrays/isInt8Array.js +2 -2
- package/sources/cores/typed-arrays/isUint16Array.js +2 -2
- package/sources/cores/typed-arrays/isUint32Array.js +2 -2
- package/sources/cores/typed-arrays/isUint8Array.js +2 -2
- package/sources/cores/typed-arrays/isUint8ClampedArray.js +2 -2
- package/sources/cores/voids/isDefined.js +2 -2
- package/sources/cores/voids/isEmpty.js +2 -2
- package/sources/cores/voids/isNull.js +3 -3
- package/sources/cores/voids/isUndefined.js +2 -2
- package/sources/dom/isEventTarget.js +2 -2
- package/sources/file-system/block-devices/isBlockDevicePath.js +9 -9
- package/sources/file-system/block-devices/isValidBlockDevicePath.js +2 -2
- package/sources/file-system/character-devices/isCharacterDevicePath.js +9 -9
- package/sources/file-system/character-devices/isValidCharacterDevicePath.js +2 -2
- package/sources/file-system/directories/isDirectoryPath.js +9 -9
- package/sources/file-system/directories/isEmptyDirectory.js +4 -4
- package/sources/file-system/directories/isValidDirectoryPath.js +2 -2
- package/sources/file-system/fifo-pipes/isFIFOPath.js +9 -9
- package/sources/file-system/fifo-pipes/isValidFIFOPath.js +2 -2
- package/sources/file-system/files/isEmptyFile.js +9 -9
- package/sources/file-system/files/isFilePath.js +9 -9
- package/sources/file-system/files/isValidFilePath.js +2 -2
- package/sources/file-system/paths/isValidPath.js +4 -4
- package/sources/file-system/sockets/isSocketPath.js +9 -9
- package/sources/file-system/sockets/isValidSocketPath.js +2 -2
- package/sources/file-system/symbolic-links/isSymbolicLinkPath.js +9 -9
- package/sources/file-system/symbolic-links/isValidSymbolicLinkPath.js +2 -2
- package/sources/itee-validators.js +1 -14
- package/sources/physics/temperatures/isCelsius.js +2 -2
- package/sources/physics/temperatures/isFahrenheit.js +2 -2
- package/sources/physics/temperatures/isKelvin.js +2 -2
- package/sources/physics/temperatures/isTemperature.js +2 -2
|
@@ -24,7 +24,7 @@ import { isNotObject } from './isObject'
|
|
|
24
24
|
* @param data {*} The data to check against the emptiness of the object
|
|
25
25
|
* @returns {boolean} true if data is an empty object, false otherwise
|
|
26
26
|
*/
|
|
27
|
-
export function isEmptyObject
|
|
27
|
+
export function isEmptyObject( data ) {
|
|
28
28
|
|
|
29
29
|
if ( isNotObject( data ) ) { return false }
|
|
30
30
|
|
|
@@ -49,6 +49,6 @@ export function isEmptyObject ( data ) {
|
|
|
49
49
|
* @param data {*} The data to check against the emptiness of the object
|
|
50
50
|
* @returns {boolean} true if data is not an empty object, false otherwise
|
|
51
51
|
*/
|
|
52
|
-
export function isNotEmptyObject
|
|
52
|
+
export function isNotEmptyObject( data ) {
|
|
53
53
|
return !( isEmptyObject( data ) )
|
|
54
54
|
}
|
|
@@ -24,7 +24,7 @@ import { isNotDefined } from '../voids/isDefined'
|
|
|
24
24
|
* @param data {*} The data to check against the object type
|
|
25
25
|
* @returns {boolean} true if data is object, false otherwise
|
|
26
26
|
*/
|
|
27
|
-
export function isObject
|
|
27
|
+
export function isObject( data ) {
|
|
28
28
|
|
|
29
29
|
if ( isNotDefined( data ) ) { return false }
|
|
30
30
|
|
|
@@ -37,6 +37,6 @@ export function isObject ( data ) {
|
|
|
37
37
|
* @param data {*} The data to check against the object type
|
|
38
38
|
* @returns {boolean} true if data is not an object, false otherwise
|
|
39
39
|
*/
|
|
40
|
-
export function isNotObject
|
|
40
|
+
export function isNotObject( data ) {
|
|
41
41
|
return !isObject( data )
|
|
42
42
|
}
|
|
@@ -25,7 +25,7 @@ import { isNotString } from './isString'
|
|
|
25
25
|
* @param data {*} The data to check against the blankness of the string
|
|
26
26
|
* @returns {boolean} true if data is a blank string, false otherwise.
|
|
27
27
|
*/
|
|
28
|
-
export function isBlankString
|
|
28
|
+
export function isBlankString( data ) {
|
|
29
29
|
|
|
30
30
|
if ( isNotString( data ) ) { return false }
|
|
31
31
|
if ( isEmptyString( data ) ) { return false }
|
|
@@ -39,7 +39,7 @@ export function isBlankString ( data ) {
|
|
|
39
39
|
* @param data {*} The data to check against the blankness of the string
|
|
40
40
|
* @returns {boolean} true if data is not a blank string, false otherwise.
|
|
41
41
|
*/
|
|
42
|
-
export function isNotBlankString
|
|
42
|
+
export function isNotBlankString( data ) {
|
|
43
43
|
|
|
44
44
|
return !( isBlankString( data ) )
|
|
45
45
|
|
|
@@ -24,7 +24,7 @@ import { isNotString } from './isString'
|
|
|
24
24
|
* @param data {*} The data to check against the emptiness of the string
|
|
25
25
|
* @returns {boolean} true if data is an empty string, false otherwise.
|
|
26
26
|
*/
|
|
27
|
-
export function isEmptyString
|
|
27
|
+
export function isEmptyString( data ) {
|
|
28
28
|
|
|
29
29
|
if ( isNotString( data ) ) {
|
|
30
30
|
return false
|
|
@@ -40,7 +40,7 @@ export function isEmptyString ( data ) {
|
|
|
40
40
|
* @param data {*} The data to check against the emptiness of the string
|
|
41
41
|
* @returns {boolean} true if data is not an empty string, false otherwise.
|
|
42
42
|
*/
|
|
43
|
-
export function isNotEmptyString
|
|
43
|
+
export function isNotEmptyString( data ) {
|
|
44
44
|
|
|
45
45
|
return !( isEmptyString( data ) )
|
|
46
46
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the string type
|
|
23
23
|
* @returns {boolean} true if data is a string, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isString
|
|
25
|
+
export function isString( data ) {
|
|
26
26
|
return ( typeof data === 'string' || data instanceof String )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,29 +32,29 @@ export function isString ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the string type
|
|
33
33
|
* @returns {boolean} true if data is not a string, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotString
|
|
35
|
+
export function isNotString( data ) {
|
|
36
36
|
return !isString( data )
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// #if IS_REMOVE_ON_BUILD
|
|
40
40
|
|
|
41
|
-
export function isString_0
|
|
41
|
+
export function isString_0( val ) {
|
|
42
42
|
return ( typeof val === 'string' )
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export function isString_1
|
|
45
|
+
export function isString_1( val ) {
|
|
46
46
|
return ( typeof val === 'string' || ( ( !!val && typeof val === 'object' ) && Object.prototype.toString.call( val ) === '[object String]' ) )
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export function isString_2
|
|
49
|
+
export function isString_2( val ) {
|
|
50
50
|
return ( Object.prototype.toString.call( val ) === '[object String]' )
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export function isString_3
|
|
53
|
+
export function isString_3( val ) {
|
|
54
54
|
return ( val !== null && val !== undefined && val.constructor === String )
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export function isString_4
|
|
57
|
+
export function isString_4( val ) {
|
|
58
58
|
return ( val === val + '' )
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the symbol type
|
|
23
23
|
* @returns {boolean} true if data is a symbol, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isSymbol
|
|
25
|
+
export function isSymbol( data ) {
|
|
26
26
|
return ( typeof data === 'symbol' )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isSymbol ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the symbol type
|
|
33
33
|
* @returns {boolean} true if data is not a symbol, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotSymbol
|
|
35
|
+
export function isNotSymbol( data ) {
|
|
36
36
|
return ( typeof data !== 'symbol' )
|
|
37
37
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* This is noParamNoReturn
|
|
8
8
|
*/
|
|
9
|
-
function noParamNoReturn
|
|
9
|
+
function noParamNoReturn() {
|
|
10
10
|
// eslint-disable-next-line no-console
|
|
11
11
|
console.log( 'Hello' )
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ function noParamNoReturn () {
|
|
|
15
15
|
*
|
|
16
16
|
* @returns {number} The response to life
|
|
17
17
|
*/
|
|
18
|
-
function noParamOneReturn
|
|
18
|
+
function noParamOneReturn() {
|
|
19
19
|
return 42
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ function noParamOneReturn () {
|
|
|
23
23
|
*
|
|
24
24
|
* @returns {string|number}
|
|
25
25
|
*/
|
|
26
|
-
function noParamTwoReturn
|
|
26
|
+
function noParamTwoReturn() {
|
|
27
27
|
return ( Math.random() >= 0.5 ) ? 'The response to life is' : 42
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@ function noParamTwoReturn () {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {string} paramA
|
|
33
33
|
*/
|
|
34
|
-
function oneParamNoReturn
|
|
34
|
+
function oneParamNoReturn( paramA = '' ) {
|
|
35
35
|
// eslint-disable-next-line no-console
|
|
36
36
|
console.log( paramA )
|
|
37
37
|
}
|
|
@@ -41,7 +41,7 @@ function oneParamNoReturn ( paramA = '' ) {
|
|
|
41
41
|
* @param {number} theParam What add to the response of life
|
|
42
42
|
* @returns {boolean} Your response to life is correct
|
|
43
43
|
*/
|
|
44
|
-
function oneParamOneReturn
|
|
44
|
+
function oneParamOneReturn( theParam = 0 ) {
|
|
45
45
|
return ( 42 === theParam )
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -50,7 +50,7 @@ function oneParamOneReturn ( theParam = 0 ) {
|
|
|
50
50
|
* @param {number} paramA
|
|
51
51
|
* @returns {null|number}
|
|
52
52
|
*/
|
|
53
|
-
function oneParamTwoReturn
|
|
53
|
+
function oneParamTwoReturn( paramA = 0 ) {
|
|
54
54
|
if ( paramA === 0 ) {
|
|
55
55
|
return null
|
|
56
56
|
} else {
|
|
@@ -63,7 +63,7 @@ function oneParamTwoReturn ( paramA = 0 ) {
|
|
|
63
63
|
* @param {string} paramA
|
|
64
64
|
* @param {number} paramB
|
|
65
65
|
*/
|
|
66
|
-
function twoParamNoReturn
|
|
66
|
+
function twoParamNoReturn( paramA = '', paramB = 123 ) {
|
|
67
67
|
// eslint-disable-next-line no-console
|
|
68
68
|
console.log( `${ paramA }:${ paramB }` )
|
|
69
69
|
}
|
|
@@ -74,7 +74,7 @@ function twoParamNoReturn ( paramA = '', paramB = 123 ) {
|
|
|
74
74
|
* @param {number} paramB
|
|
75
75
|
* @returns {string}
|
|
76
76
|
*/
|
|
77
|
-
function twoParamOneReturn
|
|
77
|
+
function twoParamOneReturn( paramA = '', paramB = 123 ) {
|
|
78
78
|
return `${ paramA }:${ paramB }`
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -84,7 +84,7 @@ function twoParamOneReturn ( paramA = '', paramB = 123 ) {
|
|
|
84
84
|
* @param {string} paramB
|
|
85
85
|
* @returns {string|number}
|
|
86
86
|
*/
|
|
87
|
-
function twoParamTwoReturn
|
|
87
|
+
function twoParamTwoReturn( paramA = 0, paramB = '' ) {
|
|
88
88
|
if ( paramA === 0 ) {
|
|
89
89
|
return paramB
|
|
90
90
|
} else {
|
|
@@ -97,7 +97,7 @@ function twoParamTwoReturn ( paramA = 0, paramB = '' ) {
|
|
|
97
97
|
* @param {*} any
|
|
98
98
|
* @returns {boolean}
|
|
99
99
|
*/
|
|
100
|
-
function anyParamOneReturn
|
|
100
|
+
function anyParamOneReturn( any ) {
|
|
101
101
|
return any != null
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the array buffer type
|
|
23
23
|
* @returns {boolean} true if data is a array buffer, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isArrayBuffer
|
|
25
|
+
export function isArrayBuffer( data ) {
|
|
26
26
|
return ( data instanceof ArrayBuffer )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isArrayBuffer ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the array buffer type
|
|
33
33
|
* @returns {boolean} true if data is not a array buffer, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotArrayBuffer
|
|
35
|
+
export function isNotArrayBuffer( data ) {
|
|
36
36
|
return !isArrayBuffer( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the big int 64 array type
|
|
23
23
|
* @returns {boolean} true if data is a big int 64 array, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isBigInt64Array
|
|
25
|
+
export function isBigInt64Array( data ) {
|
|
26
26
|
return ( data instanceof BigInt64Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isBigInt64Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the big int 64 array type
|
|
33
33
|
* @returns {boolean} true if data is not a big int 64 array, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotBigInt64Array
|
|
35
|
+
export function isNotBigInt64Array( data ) {
|
|
36
36
|
return !isBigInt64Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the big unsigned int 64 array type
|
|
23
23
|
* @returns {boolean} true if data is a big unsigned int 64 array, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isBigUint64Array
|
|
25
|
+
export function isBigUint64Array( data ) {
|
|
26
26
|
return ( data instanceof BigUint64Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isBigUint64Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the big unsigned int 64 array type
|
|
33
33
|
* @returns {boolean} true if data is not a big unsigned int 64 array, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotBigUint64Array
|
|
35
|
+
export function isNotBigUint64Array( data ) {
|
|
36
36
|
return !isBigUint64Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the float 32 array type
|
|
23
23
|
* @returns {boolean} true if data is a float 32 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isFloat32Array
|
|
25
|
+
export function isFloat32Array( data ) {
|
|
26
26
|
return ( data instanceof Float32Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isFloat32Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the float 32 array type
|
|
33
33
|
* @returns {boolean} true if data is not a float 32 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotFloat32Array
|
|
35
|
+
export function isNotFloat32Array( data ) {
|
|
36
36
|
return !isFloat32Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the float 64 array type
|
|
23
23
|
* @returns {boolean} true if data is a float 64 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isFloat64Array
|
|
25
|
+
export function isFloat64Array( data ) {
|
|
26
26
|
return ( data instanceof Float64Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isFloat64Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the float 64 array type
|
|
33
33
|
* @returns {boolean} true if data is not a float 64 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotFloat64Array
|
|
35
|
+
export function isNotFloat64Array( data ) {
|
|
36
36
|
return !isFloat64Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the int 16 array type
|
|
23
23
|
* @returns {boolean} true if data is a int 16 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isInt16Array
|
|
25
|
+
export function isInt16Array( data ) {
|
|
26
26
|
return ( data instanceof Int16Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isInt16Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the int 16 array type
|
|
33
33
|
* @returns {boolean} true if data is not a int 16 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotInt16Array
|
|
35
|
+
export function isNotInt16Array( data ) {
|
|
36
36
|
return !isInt16Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the int 32 array type
|
|
23
23
|
* @returns {boolean} true if data is a int 32 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isInt32Array
|
|
25
|
+
export function isInt32Array( data ) {
|
|
26
26
|
return ( data instanceof Int32Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isInt32Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the int 32 array type
|
|
33
33
|
* @returns {boolean} true if data is not a int 32 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotInt32Array
|
|
35
|
+
export function isNotInt32Array( data ) {
|
|
36
36
|
return !isInt32Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the int 8 array type
|
|
23
23
|
* @returns {boolean} true if data is a int 8 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isInt8Array
|
|
25
|
+
export function isInt8Array( data ) {
|
|
26
26
|
return ( data instanceof Int8Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isInt8Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the int 8 array type
|
|
33
33
|
* @returns {boolean} true if data is not a int 8 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotInt8Array
|
|
35
|
+
export function isNotInt8Array( data ) {
|
|
36
36
|
return !isInt8Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the unsigned int 16 array type
|
|
23
23
|
* @returns {boolean} true if data is a unsigned int 16 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isUint16Array
|
|
25
|
+
export function isUint16Array( data ) {
|
|
26
26
|
return ( data instanceof Uint16Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isUint16Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the unsigned int 16 array type
|
|
33
33
|
* @returns {boolean} true if data is not a unsigned int 16 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotUint16Array
|
|
35
|
+
export function isNotUint16Array( data ) {
|
|
36
36
|
return !isUint16Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the unsigned int 32 array type
|
|
23
23
|
* @returns {boolean} true if data is a unsigned int 32 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isUint32Array
|
|
25
|
+
export function isUint32Array( data ) {
|
|
26
26
|
return ( data instanceof Uint32Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isUint32Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the unsigned int 32 array type
|
|
33
33
|
* @returns {boolean} true if data is not a unsigned int 32 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotUint32Array
|
|
35
|
+
export function isNotUint32Array( data ) {
|
|
36
36
|
return !isUint32Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the unsigned int 8 array type
|
|
23
23
|
* @returns {boolean} true if data is a unsigned int 8 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isUint8Array
|
|
25
|
+
export function isUint8Array( data ) {
|
|
26
26
|
return ( data instanceof Uint8Array )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isUint8Array ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the unsigned int 8 array type
|
|
33
33
|
* @returns {boolean} true if data is not a unsigned int 8 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotUint8Array
|
|
35
|
+
export function isNotUint8Array( data ) {
|
|
36
36
|
return !isUint8Array( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the unsigned clamped int 8 array type
|
|
23
23
|
* @returns {boolean} true if data is a unsigned clamped int 8 array , false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isUint8ClampedArray
|
|
25
|
+
export function isUint8ClampedArray( data ) {
|
|
26
26
|
return ( data instanceof Uint8ClampedArray )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isUint8ClampedArray ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the unsigned clamped int 8 array type
|
|
33
33
|
* @returns {boolean} true if data is not a unsigned clamped int 8 array , false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotUint8ClampedArray
|
|
35
|
+
export function isNotUint8ClampedArray( data ) {
|
|
36
36
|
return !isUint8ClampedArray( data )
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the existence
|
|
23
23
|
* @returns {boolean} true if data is not null and not undefined, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isDefined
|
|
25
|
+
export function isDefined( data ) {
|
|
26
26
|
return ( ( data !== null ) && ( typeof data !== 'undefined' ) )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isDefined ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the existence
|
|
33
33
|
* @returns {boolean} true if data is null or undefined, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotDefined
|
|
35
|
+
export function isNotDefined( data ) {
|
|
36
36
|
return ( ( data === null ) || ( typeof data === 'undefined' ) )
|
|
37
37
|
}
|
|
@@ -29,7 +29,7 @@ import { isNotDefined } from './isDefined'
|
|
|
29
29
|
* @param data {*} The data to check against the emptiness
|
|
30
30
|
* @returns {boolean} true if data is considered as empty, false otherwise.
|
|
31
31
|
*/
|
|
32
|
-
export function isEmpty
|
|
32
|
+
export function isEmpty( data ) {
|
|
33
33
|
|
|
34
34
|
if ( isNotDefined( data ) ) { return false }
|
|
35
35
|
if ( isEmptyString( data ) ) { return true}
|
|
@@ -46,6 +46,6 @@ export function isEmpty ( data ) {
|
|
|
46
46
|
* @param data {*} The data to check against the emptiness
|
|
47
47
|
* @returns {boolean} true if data is considered as not empty, false otherwise.
|
|
48
48
|
*/
|
|
49
|
-
export function isNotEmpty
|
|
49
|
+
export function isNotEmpty( data ) {
|
|
50
50
|
return !isEmpty( data )
|
|
51
51
|
}
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
* @param data {*} The data to check against the nullity
|
|
23
23
|
* @returns {boolean} true if data is null, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isNull
|
|
25
|
+
export function isNull( data ) {
|
|
26
26
|
return ( data === null )
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// #if IS_REMOVE_ON_BUILD
|
|
30
30
|
|
|
31
|
-
export function isNull_0
|
|
31
|
+
export function isNull_0( value ) {
|
|
32
32
|
return Object.is( value, null )
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -40,6 +40,6 @@ export function isNull_0 ( value ) {
|
|
|
40
40
|
* @param data {*} The data to check against the nullity
|
|
41
41
|
* @returns {boolean} true if data is not null, false otherwise.
|
|
42
42
|
*/
|
|
43
|
-
export function isNotNull
|
|
43
|
+
export function isNotNull( data ) {
|
|
44
44
|
return ( data !== null )
|
|
45
45
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @param data {*} The data to check against the undefiness
|
|
23
23
|
* @returns {boolean} true if data is undefined, false otherwise.
|
|
24
24
|
*/
|
|
25
|
-
export function isUndefined
|
|
25
|
+
export function isUndefined( data ) {
|
|
26
26
|
return ( typeof data === 'undefined' )
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,6 +32,6 @@ export function isUndefined ( data ) {
|
|
|
32
32
|
* @param data {*} The data to check against the undefiness
|
|
33
33
|
* @returns {boolean} true if data is defined, false otherwise.
|
|
34
34
|
*/
|
|
35
|
-
export function isNotUndefined
|
|
35
|
+
export function isNotUndefined( data ) {
|
|
36
36
|
return ( typeof data !== 'undefined' )
|
|
37
37
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @param data {*}
|
|
10
10
|
* @returns {boolean}
|
|
11
11
|
*/
|
|
12
|
-
export function isEventTarget
|
|
12
|
+
export function isEventTarget( data ) {
|
|
13
13
|
return ( data instanceof EventTarget )
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -18,6 +18,6 @@ export function isEventTarget ( data ) {
|
|
|
18
18
|
* @param data {*}
|
|
19
19
|
* @returns {boolean}
|
|
20
20
|
*/
|
|
21
|
-
export function isNotEventTarget
|
|
21
|
+
export function isNotEventTarget( data ) {
|
|
22
22
|
return !isEventTarget( data )
|
|
23
23
|
}
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import
|
|
23
|
-
import { isDefined }
|
|
24
|
-
import {isNotString} from '../../cores/strings/isString'
|
|
22
|
+
import { statSync } from 'fs'
|
|
23
|
+
import { isDefined } from '../../cores/voids/isDefined'
|
|
24
|
+
import { isNotString } from '../../cores/strings/isString'
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Check if given path is a block device path
|
|
@@ -29,13 +29,13 @@ import {isNotString} from '../../cores/strings/isString';
|
|
|
29
29
|
* @param path {string|Buffer|URL} The data to check against the block device path type
|
|
30
30
|
* @returns {boolean} true if path is a block device path, false otherwise
|
|
31
31
|
*/
|
|
32
|
-
export function isBlockDevicePath
|
|
33
|
-
if( isNotString(path) && !(path instanceof Buffer) && !(path instanceof URL) ) {
|
|
34
|
-
throw new TypeError('Invalid path type! Expect string, buffer or url.')
|
|
32
|
+
export function isBlockDevicePath( path ) {
|
|
33
|
+
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
34
|
+
throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const stat =
|
|
38
|
-
return isDefined(stat) && stat.isBlockDevice()
|
|
37
|
+
const stat = statSync( path, { throwIfNoEntry: false } )
|
|
38
|
+
return isDefined( stat ) && stat.isBlockDevice()
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -44,6 +44,6 @@ export function isBlockDevicePath ( path ) {
|
|
|
44
44
|
* @param path {string|Buffer|URL} The data to check against the block device path type
|
|
45
45
|
* @returns {boolean} true if path is not a block device path, false otherwise
|
|
46
46
|
*/
|
|
47
|
-
export function isNotBlockDevicePath
|
|
47
|
+
export function isNotBlockDevicePath( path ) {
|
|
48
48
|
return !isBlockDevicePath( path )
|
|
49
49
|
}
|
|
@@ -25,7 +25,7 @@ import { isBlockDevicePath } from './isBlockDevicePath'
|
|
|
25
25
|
* @param data {*} The data to check against the block device path type
|
|
26
26
|
* @returns {boolean} true if data is a valid block device path, false otherwise
|
|
27
27
|
*/
|
|
28
|
-
export function isValidBlockDevicePath
|
|
28
|
+
export function isValidBlockDevicePath( data ) {
|
|
29
29
|
return ( isValidPath( data ) && isBlockDevicePath( data ) )
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -35,6 +35,6 @@ export function isValidBlockDevicePath ( data ) {
|
|
|
35
35
|
* @param data {*} The data to check against the block device path type
|
|
36
36
|
* @returns {boolean} true if data is an invalid block device path, false otherwise
|
|
37
37
|
*/
|
|
38
|
-
export function isInvalidBlockDevicePath
|
|
38
|
+
export function isInvalidBlockDevicePath( data ) {
|
|
39
39
|
return !isValidBlockDevicePath( data )
|
|
40
40
|
}
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import
|
|
23
|
-
import { isDefined }
|
|
24
|
-
import {isNotString} from '../../cores/strings/isString'
|
|
22
|
+
import { statSync } from 'fs'
|
|
23
|
+
import { isDefined } from '../../cores/voids/isDefined'
|
|
24
|
+
import { isNotString } from '../../cores/strings/isString'
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Check if given path is a character device path
|
|
@@ -29,13 +29,13 @@ import {isNotString} from '../../cores/strings/isString';
|
|
|
29
29
|
* @param path {string|Buffer|URL} The data to check against the character device path type
|
|
30
30
|
* @returns {boolean} true if path is a character device path, false otherwise
|
|
31
31
|
*/
|
|
32
|
-
export function isCharacterDevicePath
|
|
33
|
-
if( isNotString(path) && !(path instanceof Buffer) && !(path instanceof URL) ) {
|
|
34
|
-
throw new TypeError('Invalid path type! Expect string, buffer or url.')
|
|
32
|
+
export function isCharacterDevicePath( path ) {
|
|
33
|
+
if ( isNotString( path ) && !( path instanceof Buffer ) && !( path instanceof URL ) ) {
|
|
34
|
+
throw new TypeError( 'Invalid path type! Expect string, buffer or url.' )
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const stat =
|
|
38
|
-
return isDefined(stat) && stat.isCharacterDevice()
|
|
37
|
+
const stat = statSync( path, { throwIfNoEntry: false } )
|
|
38
|
+
return isDefined( stat ) && stat.isCharacterDevice()
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -44,6 +44,6 @@ export function isCharacterDevicePath ( path ) {
|
|
|
44
44
|
* @param path {string|Buffer|URL} The data to check against the character device path type
|
|
45
45
|
* @returns {boolean} true if path is not a character device path, false otherwise
|
|
46
46
|
*/
|
|
47
|
-
export function isNotCharacterDevicePath
|
|
47
|
+
export function isNotCharacterDevicePath( path ) {
|
|
48
48
|
return !isCharacterDevicePath( path )
|
|
49
49
|
}
|
|
@@ -25,7 +25,7 @@ import { isCharacterDevicePath } from './isCharacterDevicePath'
|
|
|
25
25
|
* @param data {*} The data to check against the character device path type
|
|
26
26
|
* @returns {boolean} true if data is a valid character device path, false otherwise
|
|
27
27
|
*/
|
|
28
|
-
export function isValidCharacterDevicePath
|
|
28
|
+
export function isValidCharacterDevicePath( data ) {
|
|
29
29
|
return ( isValidPath( data ) && isCharacterDevicePath( data ) )
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -35,6 +35,6 @@ export function isValidCharacterDevicePath ( data ) {
|
|
|
35
35
|
* @param data {*} The data to check against the character device path type
|
|
36
36
|
* @returns {boolean} true if data is an invalid character device path, false otherwise
|
|
37
37
|
*/
|
|
38
|
-
export function isInvalidCharacterDevicePath
|
|
38
|
+
export function isInvalidCharacterDevicePath( data ) {
|
|
39
39
|
return !isValidCharacterDevicePath( data )
|
|
40
40
|
}
|