Comparing version 1.0.0 to 1.1.0
@@ -231,2 +231,3 @@ "use strict"; | ||
case 'N': // Number | ||
case 'F': // Float - appears to be treated identically to Number | ||
while (len > 0 && buffer[offset] === 0x20) | ||
@@ -307,2 +308,3 @@ ++offset, --len; | ||
case 'N': // Number | ||
case 'F': // Float - appears to be treated identically to Number | ||
value = value.toString(); | ||
@@ -374,3 +376,3 @@ value = value.slice(0, field.size); | ||
} | ||
else if (type === 'N') { | ||
else if (type === 'N' || type === 'F' || type === 'I') { | ||
if (typeof value !== 'number') | ||
@@ -377,0 +379,0 @@ throw new Error('Expected a number'); |
@@ -15,3 +15,3 @@ "use strict"; | ||
throw new Error('Type must be a single character'); | ||
if (['C', 'N', 'L', 'D', 'I'].indexOf(type) === -1) | ||
if (['C', 'N', 'F', 'L', 'D', 'I'].indexOf(type) === -1) | ||
throw new Error(`Type '${type}' is not supported`); | ||
@@ -27,2 +27,4 @@ // size | ||
throw new Error('Field size is too large (maximum is 20)'); | ||
if (type === 'F' && size > 20) | ||
throw new Error('Field size is too large (maximum is 20)'); | ||
if (type === 'L' && size !== 1) | ||
@@ -29,0 +31,0 @@ throw new Error('Invalid field size (must be 1)'); |
{ | ||
"name": "dbffile", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Read and write .dbf (dBase III) files in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,3 +7,3 @@ # DBFFile | ||
- Supports `C` (string) , `N` (numeric) , `I` (integer) , `L` (logical) and `D` (date) field types | ||
- Supports `C` (string) , `N` (numeric), `F` (float), `I` (integer) , `L` (logical) and `D` (date) field types | ||
- Can open an existing .dbf file | ||
@@ -10,0 +10,0 @@ - Can access all field descriptors |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
68684
510
0