diff --git a/package-lock.json b/package-lock.json index 567369c..cd5e833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shapefile.js", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "shapefile.js", - "version": "1.1.0", + "version": "1.1.1", "license": "GPL-3.0", "dependencies": { "jszip": "^3.7.1" diff --git a/package.json b/package.json index 833565e..eb7021c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shapefile.js", - "version": "1.1.0", + "version": "1.1.1", "description": "Easily read and parse Shapefiles from the browser.", "keywords": [ "shapefiles", diff --git a/src/lib/Shapefile/Shapefile.test.ts b/src/lib/Shapefile/Shapefile.test.ts index 6f9844a..b8cccb4 100644 --- a/src/lib/Shapefile/Shapefile.test.ts +++ b/src/lib/Shapefile/Shapefile.test.ts @@ -79,9 +79,8 @@ describe('Shapefile', () => { }) test('dbf', () => { - const dbf = USA_adm1.parse('dbf', { timezone: 'Europe/Oslo', properties: true }) + const dbf = USA_adm1.parse('dbf', { properties: true }) expect(dbf.header.version).toBe(DbaseVersion.Level5) // 3 - console.log(dbf.header.lastUpdated) expect(dbf.header.lastUpdated.toISOString()).toBe('2015-08-11T00:00:00.000Z') expect(dbf.header.numberOfRecords).toBe(52) expect(dbf.header.numberOfBytesInHeader).toBe(321) diff --git a/src/lib/Shapefile/Shapefile.ts b/src/lib/Shapefile/Shapefile.ts index 457e46e..bd2e416 100644 --- a/src/lib/Shapefile/Shapefile.ts +++ b/src/lib/Shapefile/Shapefile.ts @@ -19,9 +19,9 @@ class Shapefile { this.contents = contents } - public parse(key: 'shp'): Shape; - public parse(key: 'shx'): ShapeIndex; - public parse(key: 'dbf', options: DbfOptions): Dbase; + public parse(key: 'shp'): Shape + public parse(key: 'shx'): ShapeIndex + public parse(key: 'dbf', options: DbfOptions): Dbase public parse(key: keyof ShapefileContents, ...args: any) { switch (key) { case 'shp': diff --git a/src/lib/Shapefile/parsers/dbf.ts b/src/lib/Shapefile/parsers/dbf.ts index a2ea4b6..fd078a3 100644 --- a/src/lib/Shapefile/parsers/dbf.ts +++ b/src/lib/Shapefile/parsers/dbf.ts @@ -6,7 +6,6 @@ import { } from '../../../types' export interface DbfOptions { - timezone: string properties: boolean } @@ -76,7 +75,7 @@ function getFields(array: Uint8Array, header: DbaseHeader, options } while (!terminated) bp += 1 - if (options.properties) { + if (options.properties === true) { do { for (let i = 0; i < fields.length; i++) { const valueRaw = Buffer.from(array.slice(bp, bp + fields[i].length)).toString('utf-8').trim()