Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dbffile

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbffile - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

14

dist/dbf-file.js

@@ -101,5 +101,5 @@ "use strict";

}
// Locate FoxPro9 memo file, if any. Version 0x30 may or may not have a memo file.
// Locate VFP9 or FoxPro 2 memo file, if any. Version 0x30 and 0xf5 may or may not have a memo file.
// Conventions for memo extensions: .dbf => .fpt | .pjx => .pjt | .scx => .sct | .vcx => .vct | .frx => .frt ...
if (fileVersion === 0x30) {
if (fileVersion === 0x30 || fileVersion === 0xf5) {
const dbExt = path_1.extname(path).toLowerCase();

@@ -253,3 +253,3 @@ const memoExt = dbExt == '.dbf' ? '.fpt' : `.${dbExt.substr(1, 2)}t`;

// The code below assumes the block size is at offset 4 in the .dbt for dBase IV files, and defaults to 512 if
// all zeros. For dBase III files, the block size is always 512 bytes. For VFP9 the block size is at offset 6.
// all zeros. For dBase III files, the block size is always 512 bytes. For FoxPro the block size is at offset 6.
// VFP9 memos can have a block size of 1, a special case where each block is sized to fit its value.

@@ -261,4 +261,4 @@ let memoBlockSize = 0;

memoFd = await utils_1.open(dbf._memoPath, 'r');
if (dbf._version === 0x30) {
// VFP9
if (dbf._version === 0x30 || dbf._version === 0xf5) {
// VFP9 or FoxPro 2
await utils_1.read(memoFd, buffer, 0, 2, 6);

@@ -431,4 +431,4 @@ memoBlockSize = buffer.readUInt16BE(0) || 512;

}
// Handle first/next block of FoxPro9 memo data.
else if (dbf._version === 0x30) {
// Handle first/next block of VFP9 or FoxPro 2 memo data.
else if (dbf._version === 0x30 || dbf._version === 0xf5) {
// Memo header

@@ -435,0 +435,0 @@ // 00 - 03: Next free block

@@ -1,2 +0,2 @@

export declare type FileVersion = 0x03 | 0x83 | 0x8b | 0x30;
export declare type FileVersion = 0x03 | 0x83 | 0x8b | 0x30 | 0xf5;
export declare function isValidFileVersion(fileVersion: number): fileVersion is FileVersion;

@@ -5,5 +5,5 @@ "use strict";

function isValidFileVersion(fileVersion) {
return [0x03, 0x83, 0x8b, 0x30].includes(fileVersion);
return [0x03, 0x83, 0x8b, 0x30, 0xf5].includes(fileVersion);
}
exports.isValidFileVersion = isValidFileVersion;
//# sourceMappingURL=file-version.js.map
{
"name": "dbffile",
"version": "1.11.0",
"version": "1.12.0",
"description": "Read and write .dbf (dBase III & Visual FoxPro) files in Node.js",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -5,3 +5,3 @@ # DBFFile

Read and write .dbf (dBase III and Visual FoxPro) files in Node.js:
Read and write .dbf (dBase III, dBase IV, FoxPro and Visual FoxPro) files in Node.js:

@@ -20,3 +20,3 @@ - Supported field types:

- read-only (can't create/write DBF files with memo fields)
- can only read dBase III (version 0x83), dBase IV (version 0x8b), and VFP9 (version 0x30)
- supports dBase III (version 0x83), dBase IV (version 0x8b), VFP9 (version 0x30) and FoxPro 2 (version 0xf5) memo files
- 'Loose' read mode - tries to read any kind of .dbf file without complaining. Unsupported field types are simply skipped.

@@ -23,0 +23,0 @@ - Can open an existing .dbf file

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc