bare-script 3.8.0 → 3.8.1

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 (2) hide show
  1. package/lib/library.js +5 -3
  2. package/package.json +1 -1
package/lib/library.js CHANGED
@@ -82,14 +82,16 @@ const arrayExtendArgs = valueArgsModel([
82
82
  // $group: Array
83
83
  // $doc: Flat an array hierarchy
84
84
  // $arg array: The array to flat
85
+ // $arg depth: The maximum depth of the array hierarchy
85
86
  // $return: The flated array
86
87
  function arrayFlat(args) {
87
- const [array] = valueArgsValidate(arrayFlatArgs, args);
88
- return array.flat(Infinity);
88
+ const [array, depth] = valueArgsValidate(arrayFlatArgs, args);
89
+ return array.flat(depth);
89
90
  }
90
91
 
91
92
  const arrayFlatArgs = valueArgsModel([
92
- {'name': 'array', 'type': 'array'}
93
+ {'name': 'array', 'type': 'array'},
94
+ {'name': 'depth', 'type': 'number', 'integer': true, 'default': 10}
93
95
  ]);
94
96
 
95
97
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "3.8.0",
4
+ "version": "3.8.1",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",