bare-script 3.0.3 → 3.0.4

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/lib/data.js CHANGED
@@ -74,7 +74,7 @@ const rCSVQuoteEscape = /""/g;
74
74
  * Determine data field types and parse/validate field values
75
75
  *
76
76
  * @param {Object[]} data - The data array. Row objects are updated with parsed/validated values.
77
- * @param {boolean} [csv=false] - If true, parse number and null strings
77
+ * @param {boolean} [csv=false] - If true, parse value strings
78
78
  * @returns {Object} The map of field name to field type ("datetime", "number", "string")
79
79
  * @throws Throws an error if data is invalid
80
80
  */
package/lib/library.js CHANGED
@@ -415,13 +415,14 @@ function dataTop([data = null, count = null, categoryFields = null]) {
415
415
  // $group: Data
416
416
  // $doc: Validate a data array
417
417
  // $arg data: The data array
418
+ // $arg csv: Optional (default is false). If true, parse value strings.
418
419
  // $return: The validated data array
419
- function dataValidate([data = null]) {
420
+ function dataValidate([data = null, csv = false]) {
420
421
  if (valueType(data) !== 'array') {
421
422
  return null;
422
423
  }
423
424
 
424
- validateData(data);
425
+ validateData(data, valueBoolean(csv));
425
426
  return data;
426
427
  }
427
428
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "3.0.3",
4
+ "version": "3.0.4",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",