@@ -7,7 +7,6 @@ import { TEMPLATE_VARIABLE_REGEXP } from '../constants/regex.js';
7
7
8
8
/**
9
9
* Checks if the given argument is an object
10
- *
11
10
* @param {any } x - The argument to check
12
11
* @returns {boolean } - True if the argument is an object, false otherwise
13
12
*/
@@ -16,7 +15,6 @@ export const isObject = (x) =>
16
15
17
16
/**
18
17
* Checks if the given argument is an array
19
- *
20
18
* @param {any } x - The argument to check
21
19
* @returns {boolean } - True if the argument is an array, false otherwise
22
20
*/
@@ -27,15 +25,13 @@ const isArray = (x) =>
27
25
28
26
/**
29
27
* Checks if a value is undefined or null
30
- *
31
28
* @param {any } x - The value to check
32
29
* @returns {boolean } - Returns true if the value is undefined or null, false otherwise
33
30
*/
34
31
export const isNil = ( x ) => x === undefined || x === null ;
35
32
36
33
/**
37
34
* Checks if a value is an empty value
38
- *
39
35
* @param {any } x - The value to check
40
36
* @returns {boolean } - Returns true if the value is an empty value, false otherwise
41
37
*/
@@ -46,15 +42,13 @@ export const isEmpty = (x) =>
46
42
47
43
/**
48
44
* Negates a boolean value
49
- *
50
45
* @param {boolean } x - The boolean value to negate
51
46
* @returns {boolean } The negated boolean value
52
47
*/
53
48
const not = ( x ) => ! x ;
54
49
55
50
/**
56
51
* Callback for file path
57
- *
58
52
* @callback callback
59
53
* @param {unknown } p
60
54
*/
@@ -69,22 +63,19 @@ export const pipe =
69
63
70
64
/**
71
65
* Checks if a value isn't an empty value
72
- *
73
66
* @param {any } x - The value to check
74
67
* @returns {boolean } - Returns true if the value isn't an empty value, false otherwise
75
68
*/
76
69
export const isNotEmpty = pipe ( isEmpty , not ) ;
77
70
78
71
/**
79
72
* Template function with the specified template
80
- *
81
73
* @callback templateFunction
82
74
* @param {...string } data - param array
83
75
* @returns {string } - String with replaced template variables
84
76
*/
85
77
/**
86
78
* Get template function for a template string
87
- *
88
79
* @param {string } tpl - The template string to be replaced
89
80
* @returns {templateFunction } - A function that takes in data and replaces the template variables with the corresponding values from the data object
90
81
*/
0 commit comments