xcraft-core-utils 4.10.3 → 4.10.6

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/eslint.config.js CHANGED
@@ -15,7 +15,10 @@ module.exports = [
15
15
  languageOptions: {
16
16
  parser: babelParser,
17
17
  parserOptions: {
18
- requireConfigFile: false,
18
+ requireConfigFile: false, // Évite de devoir spécifier un fichier de configuration Babel
19
+ babelOptions: {
20
+ presets: ['@babel/preset-react'],
21
+ },
19
22
  ecmaFeatures: {
20
23
  jsx: true,
21
24
  },
@@ -36,7 +39,7 @@ module.exports = [
36
39
  'eqeqeq': 'error',
37
40
  'no-console': 'off',
38
41
  'react/display-name': 'off',
39
- '@babel/no-unused-expressions': 'error',
42
+ '@babel/no-unused-expressions': 'error', // Utilisation de règles spécifiques à Babel
40
43
  'no-unused-vars': [
41
44
  'error',
42
45
  {
package/lib/async.js CHANGED
@@ -14,11 +14,11 @@ class Async {
14
14
  * be blocked and the array is very large. The purpose of this
15
15
  * helper is only for task which be done with an usual sync
16
16
  * map reduce.
17
- *
17
+ * @yields
18
18
  * @param {*} keyFunc - Key for the item in the map.
19
19
  * @param {*} valueFunc - Value for the item in the map.
20
20
  * @param {*} list - The input array.
21
- * @returns {Object} the map.
21
+ * @returns {object} the map.
22
22
  */
23
23
  *mapReduce(keyFunc, valueFunc, list) {
24
24
  const state = {};
package/lib/crypto.js CHANGED
@@ -77,7 +77,6 @@ exports.randomChar = randomChar;
77
77
 
78
78
  /**
79
79
  * Generate a random password.
80
- *
81
80
  * @param {number} [length] - The password length.
82
81
  * @param {string} [chars] - A string with the chars to use for password generation.
83
82
  * @returns {string} A random string
@@ -6,9 +6,8 @@ const fs = require('fs');
6
6
 
7
7
  /**
8
8
  * Compute the checksum of the file given as parameter using a specified algorithm.
9
- *
10
9
  * @param {string} filePath - The file path.
11
- * @param {Object} options - Options.
10
+ * @param {object} options - Options.
12
11
  * @param {string} options.algorithm - For possible values, see https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options
13
12
  * @param {string} options.encoding - (optional) Hash encoding.
14
13
  * @returns {string} The file checksum.
package/lib/json.js CHANGED
@@ -6,7 +6,7 @@ const traverse = require('xcraft-traverse');
6
6
  /**
7
7
  * @deprecated Use fse.readJSONSync instead
8
8
  * @param {*} jsonFile
9
- * @returns
9
+ * @returns {object}
10
10
  */
11
11
  exports.fromFile = function (jsonFile) {
12
12
  var data = fs.readFileSync(jsonFile, 'utf8');
@@ -24,7 +24,6 @@ exports.toFile = function (json, destFile) {
24
24
 
25
25
  /**
26
26
  * Convert keys with dots into objects
27
- *
28
27
  * @example
29
28
  * // from
30
29
  * {
@@ -38,7 +37,7 @@ exports.toFile = function (json, destFile) {
38
37
  * }
39
38
  *
40
39
  * @param {*} json
41
- * @returns
40
+ * @returns {object}
42
41
  */
43
42
  exports.dotKeysToObject = function (json) {
44
43
  const tr = traverse(json);
@@ -19,7 +19,6 @@ class RankedCache extends EventEmitter {
19
19
  * `out` topic.
20
20
  *
21
21
  * Note that a RankedCache with a limit <= 0 will just return null.
22
- *
23
22
  * @param {*} item - Push an item in the linked cache.
24
23
  * @returns {*} the ranked item (always wrapper in an Item).
25
24
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xcraft-core-utils",
3
- "version": "4.10.3",
3
+ "version": "4.10.6",
4
4
  "description": "Xcraft utils",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -46,10 +46,10 @@
46
46
  "homepage": "https://github.com/Xcraft-Inc/xcraft-core-utils#readme",
47
47
  "devDependencies": {
48
48
  "chai": "^3.5.0",
49
- "mocha": "^5.2.0",
49
+ "mocha": "^10.7.3",
50
50
  "prettier": "2.0.4",
51
51
  "xcraft-dev-prettier": "^2.0.0",
52
- "xcraft-dev-rules": "^4.4.0"
52
+ "xcraft-dev-rules": "^4.4.2"
53
53
  },
54
54
  "prettier": "xcraft-dev-prettier"
55
55
  }